uwb: adds missing error handling
authorDaeseok Youn <daeseok.youn@gmail.com>
Wed, 16 Apr 2014 09:48:02 +0000 (18:48 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Apr 2014 21:03:40 +0000 (14:03 -0700)
There is checking NULL before dereferncing but
it need to add "return".

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/uwb/drp.c

index 16ada8341c46dedb907df45392e669d42f967dec..1a2fd9795367cc719aec064b8443bacd5348f5c0 100644 (file)
@@ -599,8 +599,11 @@ static void uwb_drp_handle_alien_drp(struct uwb_rc *rc, struct uwb_ie_drp *drp_i
 
        /* alloc and initialize new uwb_cnflt_alien */
        cnflt = kzalloc(sizeof(struct uwb_cnflt_alien), GFP_KERNEL);
-       if (!cnflt)
+       if (!cnflt) {
                dev_err(dev, "failed to alloc uwb_cnflt_alien struct\n");
+               return;
+       }
+
        INIT_LIST_HEAD(&cnflt->rc_node);
        init_timer(&cnflt->timer);
        cnflt->timer.function = uwb_cnflt_timer;