Skip to content
Commit e7508d48 authored by Md Haris Iqbal's avatar Md Haris Iqbal Committed by Jens Axboe
Browse files

block/rnbd-clt: Get rid of warning regarding size argument in strlcpy



The kernel test robot triggerred the following warning,

>> drivers/block/rnbd/rnbd-clt.c:1397:42: warning: size argument in
'strlcpy' call appears to be size of the source; expected the size of the
destination [-Wstrlcpy-strlcat-size]
	strlcpy(dev->pathname, pathname, strlen(pathname) + 1);
					      ~~~~~~~^~~~~~~~~~~~~

To get rid of the above warning, use a kstrdup as Bart suggested.

Fixes: 64e8a6ec ("block/rnbd-clt: Dynamically alloc buffer for pathname & blk_symlink_name")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarMd Haris Iqbal <haris.iqbal@cloud.ionos.com>
Signed-off-by: default avatarJack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent e6582cb5
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment