From: Qinglang Miao Date: Fri, 30 Oct 2020 01:34:25 +0000 (+0100) Subject: media: usb: dvb-usb-v2: zd1301: fix missing platform_device_unregister() X-Git-Tag: Ubuntu-5.11.0-11.12~927^2~272 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=ee50d6e60d9a8e110e984cdd9e788d93eff540ba;p=mirror_ubuntu-hirsute-kernel.git media: usb: dvb-usb-v2: zd1301: fix missing platform_device_unregister() Add the missing platform_device_unregister() before return from zd1301_frontend_attach in the error handling case when pdev->dev.driver is empty. There's an error handling route named err_platform_device_unregister, so just reuse it. Signed-off-by: Qinglang Miao Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/usb/dvb-usb-v2/zd1301.c b/drivers/media/usb/dvb-usb-v2/zd1301.c index ba2c1b0d3989..72aa6a9a9ed4 100644 --- a/drivers/media/usb/dvb-usb-v2/zd1301.c +++ b/drivers/media/usb/dvb-usb-v2/zd1301.c @@ -150,7 +150,7 @@ static int zd1301_frontend_attach(struct dvb_usb_adapter *adap) } if (!pdev->dev.driver) { ret = -ENODEV; - goto err; + goto err_platform_device_unregister; } if (!try_module_get(pdev->dev.driver->owner)) { ret = -ENODEV;