Commit 1cbbd85f authored by Colin Ian King's avatar Colin Ian King Committed by Benjamin Tissoires

HID: uclogic: remove redudant duplicated null check on ver_ptr

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: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
parent 78b92f5f
...@@ -735,10 +735,6 @@ static int uclogic_params_huion_init(struct uclogic_params *params, ...@@ -735,10 +735,6 @@ static int uclogic_params_huion_init(struct uclogic_params *params,
goto cleanup; goto cleanup;
} }
rc = usb_string(udev, 201, ver_ptr, ver_len); rc = usb_string(udev, 201, ver_ptr, ver_len);
if (ver_ptr == NULL) {
rc = -ENOMEM;
goto cleanup;
}
if (rc == -EPIPE) { if (rc == -EPIPE) {
*ver_ptr = '\0'; *ver_ptr = '\0';
} else if (rc < 0) { } else if (rc < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment