From: Julia Lawall Date: Fri, 13 May 2011 15:30:46 +0000 (+0200) Subject: drivers/usb/serial/opticon.c: Release resources on kmalloc failure X-Git-Tag: v3.0-rc1~337^2~28 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0795bbf6dc6bd0a7a37d9d1ef4558e9e2b0acd6;p=pandora-kernel.git drivers/usb/serial/opticon.c: Release resources on kmalloc failure Several resources have been allocated before this kmalloc failure, and thus they should be released in this error handling code, as done in nearby error handling code. The semantic match that finds this problem is: (http://coccinelle.lip6.fr/) // @r exists@ local idexpression urb; statement S; position p1,p2; @@ urb = usb_alloc_urb@p1(...); ... when != urb if (urb == NULL) S ... when != urb ( return <+...urb...+>; | return@p2 ...; ) @script:python@ p1 << r.p1; p2 << r.p2; @@ cocci.print_main("",p1) cocci.print_secs("",p2) // Signed-off-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed