Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

RDMA: 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/20230804082102.3361961-1-ruanjinjie@huawei.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>

authored by

Ruan Jinjie and committed by
Leon Romanovsky
849b1955 26b7d1a2

+3 -3
+1 -1
drivers/infiniband/core/iwpm_util.c
··· 307 307 struct iwpm_nlmsg_request *iwpm_get_nlmsg_request(__u32 nlmsg_seq, 308 308 u8 nl_client, gfp_t gfp) 309 309 { 310 - struct iwpm_nlmsg_request *nlmsg_request = NULL; 310 + struct iwpm_nlmsg_request *nlmsg_request; 311 311 unsigned long flags; 312 312 313 313 nlmsg_request = kzalloc(sizeof(struct iwpm_nlmsg_request), gfp);
+2 -2
drivers/infiniband/hw/irdma/verbs.c
··· 2865 2865 enum irdma_memreg_type reg_type) 2866 2866 { 2867 2867 struct irdma_device *iwdev = to_iwdev(pd->device); 2868 - struct irdma_pbl *iwpbl = NULL; 2869 - struct irdma_mr *iwmr = NULL; 2868 + struct irdma_pbl *iwpbl; 2869 + struct irdma_mr *iwmr; 2870 2870 unsigned long pgsz_bitmap; 2871 2871 2872 2872 iwmr = kzalloc(sizeof(*iwmr), GFP_KERNEL);