Commit 6b0ae409 authored by Mariusz Kozlowski's avatar Mariusz Kozlowski Committed by Sage Weil

ceph: fix possible NULL pointer dereference

This patch fixes 'event_work' dereference before it is checked for NULL.
Signed-off-by: default avatarMariusz Kozlowski <mk@lab.zgora.pl>
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent ef550f6f
...@@ -1602,11 +1602,11 @@ void handle_watch_notify(struct ceph_osd_client *osdc, struct ceph_msg *msg) ...@@ -1602,11 +1602,11 @@ void handle_watch_notify(struct ceph_osd_client *osdc, struct ceph_msg *msg)
cookie, ver, event); cookie, ver, event);
if (event) { if (event) {
event_work = kmalloc(sizeof(*event_work), GFP_NOIO); event_work = kmalloc(sizeof(*event_work), GFP_NOIO);
INIT_WORK(&event_work->work, do_event_work);
if (!event_work) { if (!event_work) {
dout("ERROR: could not allocate event_work\n"); dout("ERROR: could not allocate event_work\n");
goto done_err; goto done_err;
} }
INIT_WORK(&event_work->work, do_event_work);
event_work->event = event; event_work->event = event;
event_work->ver = ver; event_work->ver = ver;
event_work->notify_id = notify_id; event_work->notify_id = notify_id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment