summaryrefslogtreecommitdiffstats
path: root/net/ceph
diff options
context:
space:
mode:
authorMariusz Kozlowski <mk@lab.zgora.pl>2011-03-26 19:29:34 +0100
committerSage Weil <sage@newdream.net>2011-03-26 13:41:20 -0700
commit6b0ae4097c1ebad98c7b33f83b4ca7e93890ed12 (patch)
tree27db559925e8e3f08522d83f4a6f3b7d32a9f2fa /net/ceph
parentef550f6f4f6c9345a27ec85d98f4f7de1adce79c (diff)
downloadlinux-6b0ae4097c1ebad98c7b33f83b4ca7e93890ed12.tar.gz
linux-6b0ae4097c1ebad98c7b33f83b4ca7e93890ed12.tar.bz2
linux-6b0ae4097c1ebad98c7b33f83b4ca7e93890ed12.zip
ceph: fix possible NULL pointer dereference
This patch fixes 'event_work' dereference before it is checked for NULL. Signed-off-by: Mariusz Kozlowski <mk@lab.zgora.pl> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'net/ceph')
-rw-r--r--net/ceph/osd_client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 02212ed50852..b6776cb627cc 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;