Skip to content

Commit

Permalink
USB: cdc-acm: use negation for NULL checks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Mar 23, 2021
1 parent 4cde059 commit f8255ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@ static int acm_probe(struct usb_interface *intf,
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);
Expand Down Expand Up @@ -1429,7 +1429,7 @@ static int acm_probe(struct usb_interface *intf,
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))
Expand Down

0 comments on commit f8255ee

Please sign in to comment.