summaryrefslogtreecommitdiff
path: root/drivers/block/rnbd/rnbd-clt-sysfs.c
diff options
context:
space:
mode:
authorDima Stepanov <dmitrii.stepanov@cloud.ionos.com>2021-04-19 10:37:22 +0300
committerJens Axboe <axboe@kernel.dk>2021-04-20 17:59:04 +0300
commit57b93ed435e6de049d190b5c1052c35d4b223631 (patch)
treefe3606da7ecf0b85deeeb4683724505bc730b7a1 /drivers/block/rnbd/rnbd-clt-sysfs.c
parent3db7cf55d532a15ea26b4a14e8f8729ccd96fd22 (diff)
downloadlinux-57b93ed435e6de049d190b5c1052c35d4b223631.tar.xz
block/rnbd: Use strscpy instead of strlcpy
During checkpatch analyzing the following warning message was found: WARNING:STRLCPY: Prefer strscpy over strlcpy - see: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Fix it by using strscpy calls instead of strlcpy. Signed-off-by: Dima Stepanov <dmitrii.stepanov@cloud.ionos.com> Signed-off-by: Jack Wang <jinpu.wang@ionos.com> Signed-off-by: Gioh Kim <gi-oh.kim@ionos.com> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Link: https://lore.kernel.org/r/20210419073722.15351-20-gi-oh.kim@ionos.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/rnbd/rnbd-clt-sysfs.c')
-rw-r--r--drivers/block/rnbd/rnbd-clt-sysfs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/rnbd/rnbd-clt-sysfs.c b/drivers/block/rnbd/rnbd-clt-sysfs.c
index 042566b47bd9..324afdd63a96 100644
--- a/drivers/block/rnbd/rnbd-clt-sysfs.c
+++ b/drivers/block/rnbd/rnbd-clt-sysfs.c
@@ -99,7 +99,7 @@ static int rnbd_clt_parse_map_options(const char *buf, size_t max_path_cnt,
kfree(p);
goto out;
}
- strlcpy(opt->sessname, p, NAME_MAX);
+ strscpy(opt->sessname, p, NAME_MAX);
kfree(p);
break;
@@ -142,7 +142,7 @@ static int rnbd_clt_parse_map_options(const char *buf, size_t max_path_cnt,
kfree(p);
goto out;
}
- strlcpy(opt->pathname, p, NAME_MAX);
+ strscpy(opt->pathname, p, NAME_MAX);
kfree(p);
break;
@@ -510,7 +510,7 @@ static int rnbd_clt_get_path_name(struct rnbd_clt_dev *dev, char *buf,
int ret;
char pathname[NAME_MAX], *s;
- strlcpy(pathname, dev->pathname, sizeof(pathname));
+ strscpy(pathname, dev->pathname, sizeof(pathname));
while ((s = strchr(pathname, '/')))
s[0] = '!';