mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 11:19:37 +00:00
staging: rtl8188eu: os_dep: usb_intf: Clean up tests if NULL returned on failure
Some functions like kmalloc/kzalloc return NULL on failure. When NULL represents failure, !x is commonly used. This was done using Coccinelle: @@ expression *e; identifier l1; @@ e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...); ... - e == NULL + !e Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6e9aeda3fa
commit
574502caed
1 changed files with 1 additions and 1 deletions
|
@ -60,7 +60,7 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
|
|||
struct usb_device *pusbd;
|
||||
|
||||
pdvobjpriv = kzalloc(sizeof(*pdvobjpriv), GFP_KERNEL);
|
||||
if (pdvobjpriv == NULL)
|
||||
if (!pdvobjpriv)
|
||||
return NULL;
|
||||
|
||||
pdvobjpriv->pusbintf = usb_intf;
|
||||
|
|
Loading…
Reference in a new issue