diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-06-10 09:57:02 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-07-20 17:17:32 +0300 |
commit | 2744d3fdcc3c49f819774ca6bee629344ae013bb (patch) | |
tree | 92061ef23b85bd86b8113c7fbef3a92b02d24647 | |
parent | 00d1d5c6c6536b755f9bfc9905f2f4b3baf2e9d7 (diff) | |
download | linux-2744d3fdcc3c49f819774ca6bee629344ae013bb.tar.xz |
media: siano: fix device register error path
[ Upstream commit 5368b1ee2939961a16e74972b69088433fc52195 ]
As reported by smatch:
drivers/media/common/siano/smsdvb-main.c:1231 smsdvb_hotplug() warn: '&client->entry' not removed from list
If an error occur at the end of the registration logic, it won't
drop the device from the list.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/media/common/siano/smsdvb-main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/common/siano/smsdvb-main.c b/drivers/media/common/siano/smsdvb-main.c index 15e895c9f2e0..cbe5f08ae9ad 100644 --- a/drivers/media/common/siano/smsdvb-main.c +++ b/drivers/media/common/siano/smsdvb-main.c @@ -1187,6 +1187,10 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev, return 0; media_graph_error: + mutex_lock(&g_smsdvb_clientslock); + list_del(&client->entry); + mutex_unlock(&g_smsdvb_clientslock); + smsdvb_debugfs_release(client); client_error: |