mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] oradax: remove redundant null check before kfree
@ 2018-09-07 10:35 Colin King
  2018-10-08  5:57 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2018-09-07 10:35 UTC (permalink / raw)
  To: David S . Miller, Rob Gardner, Jonathan Helman, sparclinux
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

A null check before a kfree is redundant, so remove it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/sbus/char/oradax.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/sbus/char/oradax.c b/drivers/sbus/char/oradax.c
index 524f9ea62e52..6516bc3cb58b 100644
--- a/drivers/sbus/char/oradax.c
+++ b/drivers/sbus/char/oradax.c
@@ -689,8 +689,7 @@ static int dax_open(struct inode *inode, struct file *f)
 alloc_error:
 	kfree(ctx->ccb_buf);
 done:
-	if (ctx != NULL)
-		kfree(ctx);
+	kfree(ctx);
 	return -ENOMEM;
 }
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-08  5:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-07 10:35 [PATCH] oradax: remove redundant null check before kfree Colin King
2018-10-08  5:57 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®