[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1527052896-30777-7-git-send-email-pankaj.laxminarayan.bharadiya@intel.com>
Date: Wed, 23 May 2018 10:51:36 +0530
From: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@...el.com>
To: alan@...ux.intel.com, sakari.ailus@...ux.intel.com,
mchehab@...nel.org, gregkh@...uxfoundation.org
Cc: linux-media@...r.kernel.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 6/6] media: staging: atomisp: Fix potential NULL pointer dereference
In verify_copy_out_frame_format(), "pipe" is being dereferenced before
it is null checked.
Fix it by moving the "pipe" pointer dereference after it has been
properly null checked.
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@...el.com>
---
drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
index eb84d51..487e768 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
@@ -455,12 +455,14 @@ static enum ia_css_frame_format yuv422_copy_formats[] = {
static enum ia_css_err
verify_copy_out_frame_format(struct ia_css_pipe *pipe)
{
- enum ia_css_frame_format out_fmt = pipe->output_info[0].format;
+ enum ia_css_frame_format out_fmt;
unsigned int i, found = 0;
assert(pipe != NULL);
assert(pipe->stream != NULL);
+ out_fmt = pipe->output_info[0].format;
+
switch (pipe->stream->config.input_config.format) {
case ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY:
case ATOMISP_INPUT_FORMAT_YUV420_8:
--
2.7.4
Powered by blists - more mailing lists