]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
usb: musb: Remove an unnecessary NULL value
authorRuan Jinjie <ruanjinjie@huawei.com>
Fri, 4 Aug 2023 09:32:52 +0000 (17:32 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Aug 2023 12:48:55 +0000 (14:48 +0200)
The NULL initialization of the pointers assigned by kzalloc() first is
not necessary, because if the kzalloc() failed, the pointers will be
assigned NULL, otherwise it works as usual. so remove it.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20230804093253.91647-5-ruanjinjie@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/musb/musb_gadget.c

index 31c44325e82872ac8558ff8465250e8f8e159f2d..051c6da7cf6d74de81ca35ed186963c2f6c9b01e 100644 (file)
@@ -1130,7 +1130,7 @@ static int musb_gadget_disable(struct usb_ep *ep)
 struct usb_request *musb_alloc_request(struct usb_ep *ep, gfp_t gfp_flags)
 {
        struct musb_ep          *musb_ep = to_musb_ep(ep);
-       struct musb_request     *request = NULL;
+       struct musb_request     *request;
 
        request = kzalloc(sizeof *request, gfp_flags);
        if (!request)