Skip to content

Commit 06fbb3d

Browse files
elfringholtmann
authored andcommitted
Bluetooth: Delete an unnecessary check before the function call "kfree_skb"
The kfree_skb() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
1 parent 56f9ebe commit 06fbb3d

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎net/bluetooth/cmtp/core.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ static inline int cmtp_recv_frame(struct cmtp_session *session, struct sk_buff *
178178
cmtp_add_msgpart(session, id, skb->data + hdrlen, len);
179179
break;
180180
default:
181-
if (session->reassembly[id] != NULL)
182-
kfree_skb(session->reassembly[id]);
181+
kfree_skb(session->reassembly[id]);
183182
session->reassembly[id] = NULL;
184183
break;
185184
}

0 commit comments

Comments
 (0)