From mboxrd@z Thu Jan 1 00:00:00 1970 From: akpm@linux-foundation.org Subject: - net-9p-trans_fdc-introduce-missing-kfree.patch removed from -mm tree Date: Wed, 01 Oct 2008 14:28:55 -0700 Message-ID: <200810012128.m91LSupf004881@imap1.linux-foundation.org> Reply-To: linux-kernel@vger.kernel.org Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:43011 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753316AbYJAV3G (ORCPT ); Wed, 1 Oct 2008 17:29:06 -0400 Sender: mm-commits-owner@vger.kernel.org List-Id: mm-commits@vger.kernel.org To: julia@diku.dk, ericvh@gmail.com, lucho@ionkov.net, rminnich@sandia.gov, mm-commits@vger.kernel.org The patch titled net/9p/trans_fd.c: introduce missing kfree has been removed from the -mm tree. Its filename was net-9p-trans_fdc-introduce-missing-kfree.patch This patch was dropped because it is obsolete The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: net/9p/trans_fd.c: introduce missing kfree From: Julia Lawall Error handling code following a kmalloc should free the allocated data. The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @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) // Signed-off-by: Julia Lawall Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov Signed-off-by: Andrew Morton --- net/9p/trans_fd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff -puN net/9p/trans_fd.c~net-9p-trans_fdc-introduce-missing-kfree net/9p/trans_fd.c --- a/net/9p/trans_fd.c~net-9p-trans_fdc-introduce-missing-kfree +++ a/net/9p/trans_fd.c @@ -787,8 +787,10 @@ static struct p9_req *p9_send_request(st else n = p9_mux_get_tag(m); - if (n < 0) + if (n < 0) { + kfree(req); return ERR_PTR(-ENOMEM); + } p9_set_tag(tc, n); _ Patches currently in -mm which might be from julia@diku.dk are git-v4l-dvb.patch git-infiniband.patch git-ieee1394.patch git-async_tx.patch git-net.patch git-mtd.patch git-sound.patch git-cpufreq.patch git-gfs2.patch git-ubifs.patch git-block.patch drivers-media-common-tuners-drop-code-after-return-or-goto.patch drivers-scsi-use-div_round_up.patch drivers-scsi-megaraid-use-div_round_up.patch net-9p-trans_fdc-introduce-missing-kfree.patch fs-9p-use-an-is_err-test-rather-than-a-null-test.patch fs-namespacec-drop-code-after-return.patch drivers-misc-use-div_round_up.patch drivers-net-xen-netfrontc-use-div_round_up.patch fs-reiserfs-use-an-is_err-test-rather-than-a-null-test.patch