Staging: atomisp: fix an uninitialized variable bug
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 20 Mar 2017 14:40:41 +0000 (14:40 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Mar 2017 07:04:32 +0000 (08:04 +0100)
There are some error paths in atomisp_css_frame_allocate() which don't
initialize "res" so it could lead us to try release random memory.

Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c

index 08da8ea062ca03310551aac7a5ca6890669d8c1d..37d334e00be08b5567f149d9100dfb2e0b3ec1b9 100644 (file)
@@ -4722,7 +4722,7 @@ static int
 atomisp_v4l2_framebuffer_to_css_frame(const struct v4l2_framebuffer *arg,
                                         struct atomisp_css_frame **result)
 {
-       struct atomisp_css_frame *res;
+       struct atomisp_css_frame *res = NULL;
        unsigned int padded_width;
        enum atomisp_css_frame_format sh_format;
        char *tmp_buf = NULL;