Skip to content

Commit

Permalink
media: firewire: fix memory leak
Browse files Browse the repository at this point in the history
Fix memory leak in node_probe.

Signed-off-by: Pavel Machek (CIP) <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
pavelmachek authored and mchehab committed Sep 27, 2020
1 parent 8c3e0f6 commit b28e327
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/media/firewire/firedtv-fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,10 @@ static int node_probe(struct fw_unit *unit, const struct ieee1394_device_id *id)

name_len = fw_csr_string(unit->directory, CSR_MODEL,
name, sizeof(name));
if (name_len < 0)
return name_len;
if (name_len < 0) {
err = name_len;
goto fail_free;
}
for (i = ARRAY_SIZE(model_names); --i; )
if (strlen(model_names[i]) <= name_len &&
strncmp(name, model_names[i], name_len) == 0)
Expand Down

0 comments on commit b28e327

Please sign in to comment.