From e7dd89cef16021ad0dd5a590d3d2090bf65e3ec2 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Fri, 25 Jan 2019 08:01:46 -0500 Subject: [PATCH] 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 --- drivers/media/v4l2-core/v4l2-ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.30.2