Skip to content

Commit

Permalink
ceph: fix possible NULL pointer dereference
Browse files Browse the repository at this point in the history
This patch fixes 'event_work' dereference before it is checked for NULL.

Signed-off-by: Mariusz Kozlowski <[email protected]>
Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
mkozlowski authored and liewegas committed Mar 26, 2011
1 parent ef550f6 commit 6b0ae40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ceph/osd_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6b0ae40

Please sign in to comment.