public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] staging: bcm2835-camera: free first element in array
@ 2017-02-15 12:25 Dan Carpenter
  2017-02-15 12:47 ` walter harms
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2017-02-15 12:25 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Eric Anholt
  Cc: Greg Kroah-Hartman, Stephen Warren, Lee Jones, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, Arnd Bergmann,
	linux-media, devel, linux-rpi-kernel, kernel-janitors

We should free gdev[0] so the > should be >=.

Fixes: 7b3ad5abf027 ("staging: Import the BCM2835 MMAL-based V4L2 camera driver.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/staging/media/platform/bcm2835/bcm2835-camera.c b/drivers/staging/media/platform/bcm2835/bcm2835-camera.c
index ca15a698e018..9bcd8e546a14 100644
--- a/drivers/staging/media/platform/bcm2835/bcm2835-camera.c
+++ b/drivers/staging/media/platform/bcm2835/bcm2835-camera.c
@@ -1998,7 +1998,7 @@ static int __init bm2835_mmal_init(void)
 free_dev:
 	kfree(dev);
 
-	for ( ; camera > 0; camera--) {
+	for ( ; camera >= 0; camera--) {
 		bcm2835_cleanup_instance(gdev[camera]);
 		gdev[camera] = NULL;
 	}

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

end of thread, other threads:[~2017-02-18 11:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-15 12:25 [patch] staging: bcm2835-camera: free first element in array Dan Carpenter
2017-02-15 12:47 ` walter harms
2017-02-16 12:03   ` Dan Carpenter
2017-02-17 23:20   ` [patch v2] staging: bcm2835-camera: fix error handling in init Dan Carpenter
2017-02-18 11:35     ` walter harms

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox