From: Markus Elfring <[email protected]>
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 <[email protected]>
---
 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

Reply via email to