From 741f378eb59c3fdb56566201637446fabfcf7801 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 2 Apr 2012 14:35:34 -0400 Subject: [PATCH] rculfhash: check malloc NULL pointer Signed-off-by: Mathieu Desnoyers --- rculfhash.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rculfhash.c b/rculfhash.c index b90a07a..1afccfd 100644 --- a/rculfhash.c +++ b/rculfhash.c @@ -1782,6 +1782,11 @@ void __cds_lfht_resize_lazy_launch(struct cds_lfht *ht) return; } work = malloc(sizeof(*work)); + if (work == NULL) { + dbg_printf("error allocating resize work, bailing out\n"); + uatomic_dec(&ht->in_progress_resize); + return; + } work->ht = ht; ht->flavor->update_call_rcu(&work->head, do_resize_cb); CMM_STORE_SHARED(ht->resize_initiated, 1); -- 2.34.1