aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorFlorian Schmaus <flo@geekplace.eu>2018-07-26 12:17:37 +0800
committerJens Axboe <axboe@kernel.dk>2018-07-27 09:15:46 -0600
commita56489d4b3c914eb30b724ff25debc2e59c7950e (patch)
tree19257babf5d48a381a5a710a86e1da91b44d926a /drivers/md
parentbcache: fix I/O significant decline while backend devices registering (diff)
downloadlinux-dev-a56489d4b3c914eb30b724ff25debc2e59c7950e.tar.xz
linux-dev-a56489d4b3c914eb30b724ff25debc2e59c7950e.zip
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@geekplace.eu> Signed-off-by: Coly Li <colyli@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/bcache/super.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index cea2a42ea276..093b3789ce05 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -2165,8 +2165,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";