All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/18] media: r820t: don't crash if attach fails
@ 2018-03-26 21:10 Mauro Carvalho Chehab
  2018-03-26 21:10 ` [PATCH 02/18] media: staging: atomisp: do some coding style improvements Mauro Carvalho Chehab
                   ` (16 more replies)
  0 siblings, 17 replies; 23+ messages in thread
From: Mauro Carvalho Chehab @ 2018-03-26 21:10 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	Mauro Carvalho Chehab, Philippe Ombredanne, Arnd Bergmann

As pointed by smatch:
	drivers/media/tuners/r820t.c:2374 r820t_attach() error: potential null dereference 'priv'.  (kzalloc returns null)

The current function with prints error assumes that the attach
succeeds. So, don't use it in case of failures.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 drivers/media/tuners/r820t.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c
index bc9299059f48..3e14b9e2e763 100644
--- a/drivers/media/tuners/r820t.c
+++ b/drivers/media/tuners/r820t.c
@@ -20,6 +20,8 @@
 //
 //	RF Gain set/get is not implemented.
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/videodev2.h>
 #include <linux/mutex.h>
 #include <linux/slab.h>
@@ -2371,7 +2373,7 @@ struct dvb_frontend *r820t_attach(struct dvb_frontend *fe,
 err_no_gate:
 	mutex_unlock(&r820t_list_mutex);
 
-	tuner_info("%s: failed=%d\n", __func__, rc);
+	pr_info("%s: failed=%d\n", __func__, rc);
 	r820t_release(fe);
 	return NULL;
 }
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2018-04-04 11:00 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-26 21:10 [PATCH 01/18] media: r820t: don't crash if attach fails Mauro Carvalho Chehab
2018-03-26 21:10 ` [PATCH 02/18] media: staging: atomisp: do some coding style improvements Mauro Carvalho Chehab
2018-04-04 10:59   ` Sakari Ailus
2018-03-26 21:10 ` [PATCH 03/18] media: staging: atomisp: ia_css_output.host: don't use var before check Mauro Carvalho Chehab
2018-03-26 21:10 ` [PATCH 04/18] media: staging atomisp: declare static vars as such Mauro Carvalho Chehab
2018-03-26 21:10 ` [PATCH 05/18] media: staging: atomisp: get rid of stupid statements Mauro Carvalho Chehab
2018-03-26 21:10 ` [PATCH 06/18] media: staging: atomisp: add a missing include Mauro Carvalho Chehab
2018-03-26 21:10 ` [PATCH 07/18] media: staging: atomisp: fix endianess issues Mauro Carvalho Chehab
2018-03-27 11:02   ` Andy Shevchenko
2018-03-28  9:25     ` Mauro Carvalho Chehab
2018-03-26 21:10 ` [PATCH 08/18] media: staging: atomisp: remove unused set_pd_base() Mauro Carvalho Chehab
2018-03-26 21:10 ` [PATCH 09/18] media: staging: atomisp: get rid of an unused function Mauro Carvalho Chehab
2018-03-26 21:10 ` [PATCH 10/18] media: staging: atomisp: Get rid of *default.host.[ch] Mauro Carvalho Chehab
2018-03-26 21:10 ` [PATCH 11/18] media: staging: atomisp: don't access a NULL var Mauro Carvalho Chehab
2018-03-26 21:10 ` [PATCH 12/18] media: staging: atomisp: avoid a warning if 32 bits build Mauro Carvalho Chehab
2018-03-28 14:13   ` Dan Carpenter
2018-03-28 14:34     ` Mauro Carvalho Chehab
2018-03-26 21:10 ` [PATCH 13/18] media: staging: atomisp: remove an useless check Mauro Carvalho Chehab
2018-03-26 21:10 ` [PATCH 14/18] media: staging: atomisp: use %p to print pointers Mauro Carvalho Chehab
2018-03-26 21:10 ` [PATCH 15/18] media: staging: atomisp: get rid of some static warnings Mauro Carvalho Chehab
2018-03-26 21:10 ` [PATCH 16/18] media: staging: atomisp: stop mixing enum types Mauro Carvalho Chehab
2018-03-26 21:10 ` [PATCH 17/18] media: staging: atomisp: get rid of an unused var Mauro Carvalho Chehab
2018-03-26 21:10 ` [PATCH 18/18] media: staging: atomisp: stop duplicating input format types Mauro Carvalho Chehab

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.