RDMA: Remove unnecessary NULL values
authorRuan Jinjie <ruanjinjie@huawei.com>
Fri, 4 Aug 2023 08:21:01 +0000 (16:21 +0800)
committerLeon Romanovsky <leon@kernel.org>
Mon, 7 Aug 2023 13:56:57 +0000 (16:56 +0300)
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/20230804082102.3361961-1-ruanjinjie@huawei.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/core/iwpm_util.c
drivers/infiniband/hw/irdma/verbs.c

index 358a2db..eecb369 100644 (file)
@@ -307,7 +307,7 @@ get_remote_info_exit:
 struct iwpm_nlmsg_request *iwpm_get_nlmsg_request(__u32 nlmsg_seq,
                                        u8 nl_client, gfp_t gfp)
 {
-       struct iwpm_nlmsg_request *nlmsg_request = NULL;
+       struct iwpm_nlmsg_request *nlmsg_request;
        unsigned long flags;
 
        nlmsg_request = kzalloc(sizeof(struct iwpm_nlmsg_request), gfp);
index 0ca5b88..660be7f 100644 (file)
@@ -2865,8 +2865,8 @@ static struct irdma_mr *irdma_alloc_iwmr(struct ib_umem *region,
                                         enum irdma_memreg_type reg_type)
 {
        struct irdma_device *iwdev = to_iwdev(pd->device);
-       struct irdma_pbl *iwpbl = NULL;
-       struct irdma_mr *iwmr = NULL;
+       struct irdma_pbl *iwpbl;
+       struct irdma_mr *iwmr;
        unsigned long pgsz_bitmap;
 
        iwmr = kzalloc(sizeof(*iwmr), GFP_KERNEL);