rculfhash: check malloc NULL pointer
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 2 Apr 2012 18:35:34 +0000 (14:35 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 2 Apr 2012 18:35:34 +0000 (14:35 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
rculfhash.c

index b90a07acc46a31746fe28bcf2afdf5d8e4e5e5bb..1afccfdfc1378ad295cbcbc8f7cec0861b800a9b 100644 (file)
@@ -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);
This page took 0.029403 seconds and 4 git commands to generate.