[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1528782443-43329-1-git-send-email-jiazhouyang09@gmail.com>
Date: Tue, 12 Jun 2018 13:47:20 +0800
From: Zhouyang Jia <jiazhouyang09@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Zhouyang Jia <jiazhouyang09@...il.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Markus Elfring <elfring@...rs.sourceforge.net>,
Colin Ian King <colin.king@...onical.com>,
Hans Verkuil <hans.verkuil@...co.com>,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2] media: tm6000: add error handling for dvb_register_adapter
When dvb_register_adapter fails, the lack of error-handling code may
cause unexpected results.
This patch adds error-handling code after calling dvb_register_adapter.
Signed-off-by: Zhouyang Jia <jiazhouyang09@...il.com>
---
drivers/media/usb/tm6000/tm6000-dvb.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/media/usb/tm6000/tm6000-dvb.c b/drivers/media/usb/tm6000/tm6000-dvb.c
index c811fc6..2e69486 100644
--- a/drivers/media/usb/tm6000/tm6000-dvb.c
+++ b/drivers/media/usb/tm6000/tm6000-dvb.c
@@ -266,6 +266,11 @@ static int register_dvb(struct tm6000_core *dev)
ret = dvb_register_adapter(&dvb->adapter, "Trident TVMaster 6000 DVB-T",
THIS_MODULE, &dev->udev->dev, adapter_nr);
+ if (ret < 0) {
+ printk(KERN_ERR "tm6000: couldn't register the adapter!\n");
+ goto err;
+ }
+
dvb->adapter.priv = dev;
if (dvb->frontend) {
--
2.7.4
Powered by blists - more mailing lists