From patchwork Sat Mar 26 18:29:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mariusz Kozlowski X-Patchwork-Id: 666011 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 p2QIU7Bj007464 for ; Sat, 26 Mar 2011 18:30:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753603Ab1CZS3n (ORCPT ); Sat, 26 Mar 2011 14:29:43 -0400 Received: from unix.wroclaw.pl ([94.23.28.62]:56354 "EHLO unix.wroclaw.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753593Ab1CZS3m (ORCPT ); Sat, 26 Mar 2011 14:29:42 -0400 Received: from dynamic-78-8-223-146.ssp.dialog.net.pl ([78.8.223.146]:38501 helo=localhost.localdomain) by unix.wroclaw.pl with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1Q3YF0-0007SU-PA; Sat, 26 Mar 2011 19:29:39 +0100 From: Mariusz Kozlowski To: Sage Weil Cc: "David S. Miller" , ceph-devel@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Mariusz Kozlowski Subject: [PATCH] ceph: fix possible NULL pointer dereference Date: Sat, 26 Mar 2011 19:29:34 +0100 Message-Id: <1301164174-8597-1-git-send-email-mk@lab.zgora.pl> X-Mailer: git-send-email 1.7.0.4 X-SA-Report: SpamAssassin 3.2.5 (2008-06-10) on unix.wroclaw.pl Spam=No score=-1.4 bayes=0.5 autolearn=disabled Spam Tests: * -1.4 ALL_TRUSTED Passed through trusted hosts only via SMTP 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]); Sat, 26 Mar 2011 18:30:07 +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;