From: Hans Petter Selasky Date: Fri, 25 Jan 2019 13:01:46 +0000 (-0500) Subject: media: strscpy() returns a negative value on failure unlike strlcpy(). X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=e7dd89cef16021ad0dd5a590d3d2090bf65e3ec2;p=openwrt%2Fstaging%2Fblogic.git media: strscpy() returns a negative value on failure unlike strlcpy(). strscpy() returns a negative value on failure unlike strlcpy(), so fix the WARN_ON accordingly. Signed-off-by: Hans Petter Selasky Signed-off-by: Hans Verkuil [hverkuil-cisco@xs4all.nl: added commit message] Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index f6d663934648..038739584a84 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1373,7 +1373,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) } if (descr) - WARN_ON(strscpy(fmt->description, descr, sz) >= sz); + WARN_ON(strscpy(fmt->description, descr, sz) < 0); fmt->flags = flags; }