usb: gadget: udc: Remove unnecessary NULL values

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-2-ruanjinjie@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Ruan Jinjie 2023-08-04 17:32:49 +08:00 committed by Greg Kroah-Hartman
parent 803b1c8a0c
commit 3024faf74d
3 changed files with 4 additions and 4 deletions

View File

@ -671,7 +671,7 @@ static int fsl_ep_disable(struct usb_ep *_ep)
static struct usb_request *
fsl_alloc_request(struct usb_ep *_ep, gfp_t gfp_flags)
{
struct fsl_req *req = NULL;
struct fsl_req *req;
req = kzalloc(sizeof *req, gfp_flags);
if (!req)

View File

@ -665,7 +665,7 @@ static int mv_u3d_ep_disable(struct usb_ep *_ep)
static struct usb_request *
mv_u3d_alloc_request(struct usb_ep *_ep, gfp_t gfp_flags)
{
struct mv_u3d_req *req = NULL;
struct mv_u3d_req *req;
req = kzalloc(sizeof *req, gfp_flags);
if (!req)
@ -1779,7 +1779,7 @@ static void mv_u3d_remove(struct platform_device *dev)
static int mv_u3d_probe(struct platform_device *dev)
{
struct mv_u3d *u3d = NULL;
struct mv_u3d *u3d;
struct mv_usb_platform_data *pdata = dev_get_platdata(&dev->dev);
int retval = 0;
struct resource *r;

View File

@ -595,7 +595,7 @@ static int mv_ep_disable(struct usb_ep *_ep)
static struct usb_request *
mv_alloc_request(struct usb_ep *_ep, gfp_t gfp_flags)
{
struct mv_req *req = NULL;
struct mv_req *req;
req = kzalloc(sizeof *req, gfp_flags);
if (!req)