Skip to contentSkip to conversation

wimax: checking ERR_PTR vs null

PATCH In review Dan Carpenter 2 participants 2 messages Apr 22, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wimax: checking ERR_PTR vs null

stch_skb is allocated with wimax_gnl_re_state_change_alloc(). That function returns ERR_PTRs on failure and doesn't return NULL.

net/wimax/stack.c +1 -1
index 1ed65db..62b1a66 100644
@@ -315,7 +315,7 @@ void __wimax_state_change(struct wimax_dev *wimax_dev, enum wimax_st new_state)
 		BUG();
 	}
 	__wimax_state_set(wimax_dev, new_state);
-	if (stch_skb)
+	if (!IS_ERR(stch_skb))
 		wimax_gnl_re_state_change_send(wimax_dev, stch_skb, header);
 out:
 	d_fnend(3, dev, "(wimax_dev %p new_state %u [old %u]) = void\n",
#1 lore raw
Quoted 4 lines · Dan Carpenter

stch_skb is allocated with wimax_gnl_re_state_change_alloc(). That function returns ERR_PTRs on failure and doesn't return NULL.

ACK, thanks [and thanks to davem for reminding me]