]> git.baikalelectronics.ru Git - kernel.git/commit
staging: bcm2835-camera: fix error handling in init
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 17 Feb 2017 23:20:15 +0000 (02:20 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Mar 2017 08:17:02 +0000 (09:17 +0100)
commit2964ecc4cc54a9898d6c42dfd7dca62507962561
tree52110d34a141bfbca8e5724c3fd0b4b28f8bfedf
parent682dd00a92ef5881cffee4e2acf2a91ec9df26ff
staging: bcm2835-camera: fix error handling in init

The unwinding here isn't right.  We don't free gdev[0] and instead
free 1 step past what was allocated.  Also we can't allocate "dev" then
we should unwind instead of returning directly.

Fixes: 1a5643cbb0e3 ("staging: Import the BCM2835 MMAL-based V4L2 camera driver.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: walter harms <wharms@bfs.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/platform/bcm2835/bcm2835-camera.c