linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [media] s5k6aa: Fix possible NULL pointer dereference
@ 2012-09-22  7:28 Sachin Kamat
  2012-09-25 21:58 ` Sylwester Nawrocki
  0 siblings, 1 reply; 3+ messages in thread
From: Sachin Kamat @ 2012-09-22  7:28 UTC (permalink / raw)
  To: linux-media; +Cc: s.nawrocki, mchehab, sachin.kamat, patches

It is previously assumed that 'rect' could be NULL.
Hence add a check to print the members of 'rect' only when it is not
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/media/i2c/s5k6aa.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/s5k6aa.c b/drivers/media/i2c/s5k6aa.c
index 045ca7f..7531edb 100644
--- a/drivers/media/i2c/s5k6aa.c
+++ b/drivers/media/i2c/s5k6aa.c
@@ -1177,8 +1177,9 @@ static int s5k6aa_get_crop(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
 
 	mutex_unlock(&s5k6aa->lock);
 
-	v4l2_dbg(1, debug, sd, "Current crop rectangle: (%d,%d)/%dx%d\n",
-		 rect->left, rect->top, rect->width, rect->height);
+	if (rect)
+		v4l2_dbg(1, debug, sd, "Current crop rectangle: (%d,%d)/%dx%d\n",
+			 rect->left, rect->top, rect->width, rect->height);
 
 	return 0;
 }
-- 
1.7.4.1


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

end of thread, other threads:[~2012-09-26  3:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-22  7:28 [PATCH] [media] s5k6aa: Fix possible NULL pointer dereference Sachin Kamat
2012-09-25 21:58 ` Sylwester Nawrocki
2012-09-26  3:28   ` Sachin Kamat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).