The patch titled drivers/video/backlight/da903x.c: introduce missing kfree has been added to the -mm tree. Its filename is drivers-video-backlight-da903xc-introduce-missing-kfree.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: drivers/video/backlight/da903x.c: introduce missing kfree From: Julia Lawall <julia@xxxxxxx> Error handling code following a kzalloc should free the allocated data. The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @r exists@ local idexpression x; statement S; expression E; identifier f,l; position p1,p2; expression *ptr != NULL; @@ ( if ((x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...)) == NULL) S | x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...); ... if (x == NULL) S ) <... when != x when != if (...) { <+...x...+> } x->f = E ...> ( return \(0\|<+...x...+>\|ptr\); | return@p2 ...; ) @script:python@ p1 << r.p1; p2 << r.p2; @@ print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line) // </smpl> Signed-off-by: Julia Lawall <julia@xxxxxxx> Cc: Mike Rapoport <mike@xxxxxxxxxxxxxx> Cc: Richard Purdie <rpurdie@xxxxxxxxxxxxxxx> Cc: Eric Miao <eric.miao@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/video/backlight/da903x.c | 1 + 1 file changed, 1 insertion(+) diff -puN drivers/video/backlight/da903x.c~drivers-video-backlight-da903xc-introduce-missing-kfree drivers/video/backlight/da903x.c --- a/drivers/video/backlight/da903x.c~drivers-video-backlight-da903xc-introduce-missing-kfree +++ a/drivers/video/backlight/da903x.c @@ -119,6 +119,7 @@ static int da903x_backlight_probe(struct default: dev_err(&pdev->dev, "invalid backlight device ID(%d)\n", pdev->id); + kfree(data); return -EINVAL; } _ Patches currently in -mm which might be from julia@xxxxxxx are drivers-video-bad-error-test-before-a-dereference.patch linux-next.patch drivers-media-use-array_size.patch drivers-mtd-maps-nettelc-use-array_size.patch net-tipc-bcasth-use-array_size.patch drivers-isdn-misdn-use-array_size.patch drivers-message-fusion-use-array_size.patch fs-namespacec-drop-code-after-return.patch drivers-net-wireless-ath9k-rcc-use-array_size.patch drivers-video-backlight-da903xc-introduce-missing-kfree.patch kernel-trace-tracec-introduce-missing-kfree.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html