Skip to contentSkip to conversation

brcm80211: brcmu_pkt_buf_free_skb() should handle NULL

PATCH In review Dan Carpenter 3 participants 6 messages May 15, 2012

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

PATCH 1/1 brcm80211: brcmu_pkt_buf_free_skb() should handle NULL

This is potentially called with NULL pointers, for example, look at brcmf_c_prec_enq(). Since it's a free() function, probably people expect it to handle NULL pointers.

drivers/net/wireless/brcm80211/brcmutil/utils.c +2 -0
index b45ab34..3e6405e 100644
@@ -43,6 +43,8 @@ EXPORT_SYMBOL(brcmu_pkt_buf_get_skb);
 /* Free the driver packet. Free the tag if present */
 void brcmu_pkt_buf_free_skb(struct sk_buff *skb)
 {
+	if (!skb)
+		return;
 	WARN_ON(skb->next);
 	if (skb->destructor)
 		/* cannot kfree_skb() on hard IRQ (net/core/skbuff.c) if
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Dan Carpenter

This is potentially called with NULL pointers, for example, look at brcmf_c_prec_enq(). Since it's a free() function, probably people expect it to handle NULL pointers.

drivers/net/wireless/brcm80211/brcmutil/utils.c

Quoted 4 lines
drivers/net/wireless/brcm80211/brcmutil/utils.c +0 -0
index b45ab34..3e6405e 100644

Is the diff command filtered properly here. In most patches I usually see '---' immediatly after the Signed-off-by line.

drivers/net/wireless/brcm80211/brcmutil/utils.c EXPORT_SYMBOL(brcmu_pkt_buf_get_skb); · line 50

Quoted 12 lines
drivers/net/wireless/brcm80211/brcmutil/utils.c +2 -0
@@ -43,6 +43,8 @@ EXPORT_SYMBOL(brcmu_pkt_buf_get_skb);
 /* Free the driver packet. Free the tag if present */
 void brcmu_pkt_buf_free_skb(struct sk_buff *skb)
 {
+	if (!skb)
+		return;
 	WARN_ON(skb->next);
 	if (skb->destructor)
 		/* cannot kfree_skb() on hard IRQ (net/core/skbuff.c) if

Gr. AvS

#3 lore raw
In reply to Arend van Spriel
Quoted 7 lines · Arend van Spriel
Quoted 3 lines · Dan Carpenter

This is potentially called with NULL pointers, for example, look at brcmf_c_prec_enq(). Since it's a free() function, probably people expect it to handle NULL pointers.

Quoted 8 lines

drivers/net/wireless/brcm80211/brcmutil/utils.c

Quoted 4 lines
drivers/net/wireless/brcm80211/brcmutil/utils.c +0 -0
index b45ab34..3e6405e 100644

Is the diff command filtered properly here. In most patches I usually see '---' immediatly after the Signed-off-by line.

Yeah. Normally git puts the diffstat there, but my scripts leave it out. All my patches are tiny anyway. ;)

regards,
dan carpenter

#4 lore raw
Quoted 17 lines · Dan Carpenter
Quoted 7 lines · Arend van Spriel
Quoted 3 lines · Dan Carpenter

This is potentially called with NULL pointers, for example, look at brcmf_c_prec_enq(). Since it's a free() function, probably people expect it to handle NULL pointers.

Quoted 8 lines

drivers/net/wireless/brcm80211/brcmutil/utils.c

Quoted 4 lines
drivers/net/wireless/brcm80211/brcmutil/utils.c +0 -0
index b45ab34..3e6405e 100644

Is the diff command filtered properly here. In most patches I usually see '---' immediatly after the Signed-off-by line.

Quoted 2 lines

Yeah. Normally git puts the diffstat there, but my scripts leave it out. All my patches are tiny anyway. ;)

The documentation says:

The canonical patch message body contains the following:

- A "from" line specifying the patch author.

- An empty line.

- The body of the explanation, which will be copied to the permanent changelog to describe this patch.

- The "Signed-off-by:" lines, described above, which will also go in the changelog.

- A marker line containing simply "---".

- Any additional comments not suitable for the changelog.

- The actual patch (diff output).

The --- is not attached to the diffstat, as far as I can see.

julia

#5 lore raw
Quoted 5 lines · Julia Lawall

1 - A marker line containing simply "---".

2 - Any additional comments not suitable for the changelog.

I guess that 1 can be omitted when there is no 2. I was just wondering whether the diff command would end up in the changelog when applying the patch.

Gr. AvS