[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180618100902.4015-2-flo@geekplace.eu>
Date: Mon, 18 Jun 2018 12:09:00 +0200
From: Florian Schmaus <flo@...kplace.eu>
To: Coly Li <colyli@...e.de>,
Kent Overstreet <kent.overstreet@...il.com>,
linux-bcache@...r.kernel.org
Cc: Florian Schmaus <flo@...kplace.eu>, linux-kernel@...r.kernel.org
Subject: [PATCH 1/3] bcache: do not assign in if condition register_bcache()
Fixes an error condition reported by checkpatch.pl which is caused by
assigning a variable in an if condition.
Signed-off-by: Florian Schmaus <flo@...kplace.eu>
---
drivers/md/bcache/super.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index fa4058e43202..db7177d422e5 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -2163,8 +2163,12 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr,
if (!try_module_get(THIS_MODULE))
return -EBUSY;
- if (!(path = kstrndup(buffer, size, GFP_KERNEL)) ||
- !(sb = kmalloc(sizeof(struct cache_sb), GFP_KERNEL)))
+ path = kstrndup(buffer, size, GFP_KERNEL);
+ if (!path)
+ goto err;
+
+ sb = kmalloc(sizeof(struct cache_sb), GFP_KERNEL);
+ if (!sb)
goto err;
err = "failed to open device";
--
2.16.4
Powered by blists - more mailing lists