Browse Source

soc: swr-mstr-ctrl: fix device linked list corruption issue

It was found that kernel crashes due to device linked list corruption
when soundwire controller driver tries to register soundwire peripheral
device. This is due to error handling logic does not remove device which
fails to register from device linked list maintained by soundwire
controller driver.

Change-Id: I0bb52bbc11bc4535f22c0490edb9c4aee48050dc
Signed-off-by: Patrick Lai <[email protected]>
Patrick Lai 4 years ago
parent
commit
721e71211c
1 changed files with 1 additions and 0 deletions
  1. 1 0
      soc/soundwire.c

+ 1 - 0
soc/soundwire.c

@@ -141,6 +141,7 @@ err_out:
 	dev_dbg(&master->dev, "Failed to register swr device %s at 0x%lx %d\n",
 		swr->name, swr->addr, result);
 	swr_master_put(master);
+	list_del_init(&swr->dev_list);	
 	kfree(swr);
 	return NULL;
 }