Commit e7dd89ce authored by Hans Petter Selasky's avatar Hans Petter Selasky Committed by Mauro Carvalho Chehab
Browse files

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: default avatarHans Petter Selasky <hps@selasky.org>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil-cisco@xs4all.nl: added commit message]
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 6f3f3e11
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}