lkml.org 
[lkml]   [2018]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 5/6] media: staging: atomisp: Fix potential NULL pointer dereference
Date
In sh_css_config_input_network(), "stream" is being dereferenced
before it is null checked.
Fix it by moving the "stream" pointer dereference after it has been
properly null checked.

Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
---
drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c | 3 ++-
1 file changed, 2 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 c771e4b..eb84d51 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
@@ -529,11 +529,12 @@ static enum ia_css_err
sh_css_config_input_network(struct ia_css_stream *stream)
{
unsigned int fmt_type;
- struct ia_css_pipe *pipe = stream->last_pipe;
+ struct ia_css_pipe *pipe;
struct ia_css_binary *binary = NULL;
enum ia_css_err err = IA_CSS_SUCCESS;

assert(stream != NULL);
+ pipe = stream->last_pipe;
assert(pipe != NULL);

ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
--
2.7.4
\
 
 \ /
  Last update: 2018-05-23 07:28    [W:0.035 / U:25.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site