From patchwork Tue Mar 29 03:25:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 670562 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2T3M9u2018283 for ; Tue, 29 Mar 2011 03:25:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755667Ab1C2DZq (ORCPT ); Mon, 28 Mar 2011 23:25:46 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:53173 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753450Ab1C2DZp (ORCPT ); Mon, 28 Mar 2011 23:25:45 -0400 Received: by fxm17 with SMTP id 17so3163692fxm.19 for ; Mon, 28 Mar 2011 20:25:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=SYPV1VFeEhbpk39AMHbRtUd4/jMSGoW4SWI4UUk38+I=; b=N3vM9OfqVrN8XnnvAKvSb+tefa94efKGZcAqG4QplGZBfbk+UyYUyvM1Tr6LKmBenX oMxx+y9D0/tjGBnpWzeE146nO8sb+aaPFdSUOgPUwn/oC9zOfuftOzFTg6IffkVgvSTg PxLXTx4Tq71ChcjbZZT2FwVesiJ4/m/OhkDnE= 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=ry5OJizBt9wdOeNoXdMcrH2hNxIteQaWhNGt08ALUo4YXgadL55w/uaofpTcBXaZ14 w6izQ/1tMzhURcm4mGUP+tcl1KhzK2usd8AYj5tZVq631p3Jw9JoPupLxhyHeqX1KXJ/ 9H3X6DcOUjwrJH9eTa1kmVH4VWI5vWRx+TfxI= Received: by 10.223.9.137 with SMTP id l9mr5220836fal.25.1301369144434; Mon, 28 Mar 2011 20:25:44 -0700 (PDT) Received: from bicker ([212.49.88.34]) by mx.google.com with ESMTPS id k5sm1749836faa.39.2011.03.28.20.25.40 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 28 Mar 2011 20:25:43 -0700 (PDT) Date: Tue, 29 Mar 2011 06:25:29 +0300 From: Dan Carpenter To: Sage Weil Cc: ceph-devel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch 1/2] ceph: null deref on allocation failure Message-ID: <20110329032529.GE9856@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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.6 (demeter1.kernel.org [140.211.167.41]); Tue, 29 Mar 2011 03:25:47 +0000 (UTC) diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 02212ed..b6776cb 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -1602,11 +1602,11 @@ void handle_watch_notify(struct ceph_osd_client *osdc, struct ceph_msg *msg) cookie, ver, event); if (event) { event_work = kmalloc(sizeof(*event_work), GFP_NOIO); - INIT_WORK(&event_work->work, do_event_work); if (!event_work) { dout("ERROR: could not allocate event_work\n"); goto done_err; } + INIT_WORK(&event_work->work, do_event_work); event_work->event = event; event_work->ver = ver; event_work->notify_id = notify_id;