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 <hps@selasky.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil-cisco@xs4all.nl: added commit message]
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
Hans Petter Selasky 2019-01-25 08:01:46 -05:00 committed by Mauro Carvalho Chehab
parent 6f3f3e1199
commit e7dd89cef1
1 changed files with 1 additions and 1 deletions

View File

@ -1373,7 +1373,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
} }
if (descr) if (descr)
WARN_ON(strscpy(fmt->description, descr, sz) >= sz); WARN_ON(strscpy(fmt->description, descr, sz) < 0);
fmt->flags = flags; fmt->flags = flags;
} }