Skip to content

Commit

Permalink
HID: uclogic: remove redudant duplicated null check on ver_ptr
Browse files Browse the repository at this point in the history
Currently ver_ptr is being null checked twice, once before calling
usb_string and once afterwards.  The second null check is redundant
and can be removed, remove it.

Detected by CoverityScan, CID#1477308 ("Logically dead code")

Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
  • Loading branch information
Colin Ian King authored and bentiss committed Mar 11, 2019
1 parent 78b92f5 commit 1cbbd85
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions drivers/hid/hid-uclogic-params.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,10 +735,6 @@ static int uclogic_params_huion_init(struct uclogic_params *params,
goto cleanup;
}
rc = usb_string(udev, 201, ver_ptr, ver_len);
if (ver_ptr == NULL) {
rc = -ENOMEM;
goto cleanup;
}
if (rc == -EPIPE) {
*ver_ptr = '\0';
} else if (rc < 0) {
Expand Down

0 comments on commit 1cbbd85

Please sign in to comment.