[PATCH] virtio-balloon: Delete an unnecessary check before the function call "iput"

From
SF Markus Elfring <hidden>
Date
2016-07-18 19:25:02
From: Markus Elfring <redacted>
Date: Mon, 18 Jul 2016 21:17:18 +0200

The iput() 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 <redacted>
---
 drivers/virtio/virtio_balloon.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 888d5f8..81f7d6c 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -611,8 +611,7 @@ static void virtballoon_remove(struct virtio_device *vdev)
 	cancel_work_sync(&vb->update_balloon_stats_work);
 
 	remove_common(vb);
-	if (vb->vb_dev_info.inode)
-		iput(vb->vb_dev_info.inode);
+	iput(vb->vb_dev_info.inode);
 	kfree(vb);
 }
 
-- 
2.9.2
Thread (1 message) 1 message, 1 author, last reply 2016-07-18
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help