]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
USB: cdc-acm: use negation for NULL checks
authorJohan Hovold <johan@kernel.org>
Mon, 22 Mar 2021 15:53:16 +0000 (16:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Mar 2021 12:27:13 +0000 (13:27 +0100)
Use negation consistently throughout the driver for NULL checks.

Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210322155318.9837-7-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/cdc-acm.c

index 4844f50e54de26ba73bdef5d567e1ea6dab95754..1f0fcabef5d2e77feade11e8611800a62931fd5c 100644 (file)
@@ -1336,7 +1336,7 @@ made_compressed_probe:
        dev_dbg(&intf->dev, "interfaces are valid\n");
 
        acm = kzalloc(sizeof(struct acm), GFP_KERNEL);
-       if (acm == NULL)
+       if (!acm)
                return -ENOMEM;
 
        tty_port_init(&acm->port);
@@ -1429,7 +1429,7 @@ made_compressed_probe:
                struct acm_wb *snd = &(acm->wb[i]);
 
                snd->urb = usb_alloc_urb(0, GFP_KERNEL);
-               if (snd->urb == NULL)
+               if (!snd->urb)
                        goto err_free_write_urbs;
 
                if (usb_endpoint_xfer_int(epwrite))