[PATCH 1/2] ipc/mqueue: Delete an unnecessary check before the macro call âdev_kfree_skbâ

From: Markus Elfring
Date: Thu Aug 22 2019 - 10:58:52 EST


From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 22 Aug 2019 14:07:57 +0200

The dev_kfree_skb() function performs also input parameter validation.
Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
ipc/mqueue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 7a5a8edc3de3..494ab78863f4 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -1334,7 +1334,7 @@ static int do_mq_notify(mqd_t mqdes, const struct sigevent *notification)
out:
if (sock)
netlink_detachskb(sock, nc);
- else if (nc)
+ else
dev_kfree_skb(nc);

return ret;
--
2.23.0