From patchwork Thu Jul 8 12:49:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 110832 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o68CqUwb004098 for ; Thu, 8 Jul 2010 12:52:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756331Ab0GHMwM (ORCPT ); Thu, 8 Jul 2010 08:52:12 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:39705 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755840Ab0GHMwK (ORCPT ); Thu, 8 Jul 2010 08:52:10 -0400 Received: by wwb24 with SMTP id 24so3778653wwb.1 for ; Thu, 08 Jul 2010 05:52:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=NxFSnSIKO+faQwjzoX7Zx42uV2/o0GBos/nwpuqkmSw=; b=x4mm1QLH04EpnGwQq84XDNVKYA8eYDfkIlImlbyGnLU2GN2HZmDRzjPESQGzC9HGOw kbcr3IAcje3tg7rtlasVl9H4EXpbxA52hRH9OHbKG7CFfGSXQqIVZCrBW+ehiHkEioh8 HuOX7Q+y+tn+t8Gk9ugrbzz1YW4kV2RaoewYA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=ZTbOVfRsMLDPyA5JWZok5y5XX6B9YPet3HmjXclla7oG98DVISbMwMilBdd24Upiej Uw9/tQI9m1qtfTYNflwrgd4xSd3LoIcGyk37qdspVWAP+UDPxbmYscovILgsbTrpMFIU iED7d2uEGDm0W1gEev+psxkV3yieq2hMwEa98= Received: by 10.216.180.201 with SMTP id j51mr2457305wem.46.1278593528247; Thu, 08 Jul 2010 05:52:08 -0700 (PDT) Received: from bicker ([205.177.176.130]) by mx.google.com with ESMTPS id k69sm108943wej.42.2010.07.08.05.52.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 08 Jul 2010 05:52:07 -0700 (PDT) Date: Thu, 8 Jul 2010 14:49:38 +0200 From: Dan Carpenter To: Sage Weil Cc: Noah Watkins , ceph-devel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] ceph: add kfree() to error path Message-ID: <20100708124938.GJ19184@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 08 Jul 2010 12:52:30 +0000 (UTC) diff --git a/fs/ceph/osdmap.c b/fs/ceph/osdmap.c index 50ce64e..277f8b3 100644 --- a/fs/ceph/osdmap.c +++ b/fs/ceph/osdmap.c @@ -568,6 +568,7 @@ struct ceph_osdmap *osdmap_decode(void **p, void *end) if (ev > CEPH_PG_POOL_VERSION) { pr_warning("got unknown v %d > %d of ceph_pg_pool\n", ev, CEPH_PG_POOL_VERSION); + kfree(pi); goto bad; } __decode_pool(p, pi);