media: firewire: Using uninitialized values in node_probe()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 8 May 2020 14:40:22 +0000 (16:40 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sat, 4 Jul 2020 09:57:10 +0000 (11:57 +0200)
commit2505a210fc126599013aec2be741df20aaacc490
treeffdda8d253e4c6c1ee357f677d17fa9c24d97f90
parent20171723144ca0d057b72e852536992fd371369a
media: firewire: Using uninitialized values in node_probe()

If fw_csr_string() returns -ENOENT, then "name" is uninitialized.  So
then the "strlen(model_names[i]) <= name_len" is true because strlen()
is unsigned and -ENOENT is type promoted to a very high positive value.
Then the "strncmp(name, model_names[i], name_len)" uses uninitialized
data because "name" is uninitialized.

Fixes: 92374e886c75 ("[media] firedtv: drop obsolete backend abstraction")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/firewire/firedtv-fw.c