Skip to contentSkip to conversation

uwb: adds missing error handling

PATCH New Daeseok Youn 1 participant 1 message Apr 16, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uwb: adds missing error handling

There is checking NULL before dereferncing but
it need to add "return".

---
 drivers/uwb/drp.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/uwb/drp.c +4 -1
index 16ada83..1a2fd97 100644
@@ -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;
Signature · 1 line
1.7.4.4