Message ID | 20210610074952.15765-1-thunder.leizhen@huawei.com |
---|---|
State | Superseded |
Headers | show |
Series | [1/1] scsi: libcxgbi: remove unnecessary oom message | expand |
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c index 8c7d4dda4cf2994..df370fb5dd86f96 100644 --- a/drivers/scsi/cxgbi/libcxgbi.c +++ b/drivers/scsi/cxgbi/libcxgbi.c @@ -556,12 +556,11 @@ EXPORT_SYMBOL_GPL(cxgbi_sock_free_cpl_skbs); static struct cxgbi_sock *cxgbi_sock_create(struct cxgbi_device *cdev) { - struct cxgbi_sock *csk = kzalloc(sizeof(*csk), GFP_NOIO); + struct cxgbi_sock *csk; - if (!csk) { - pr_info("alloc csk %zu failed.\n", sizeof(*csk)); + csk = kzalloc(sizeof(*csk), GFP_NOIO); + if (!csk) return NULL; - } if (cdev->csk_alloc_cpls(csk) < 0) { pr_info("csk 0x%p, alloc cpls failed.\n", csk);
Fixes scripts/checkpatch.pl warning: WARNING: Possible unnecessary 'out of memory' message Remove it can help us save a bit of memory. Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> --- drivers/scsi/cxgbi/libcxgbi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.26.0.106.g9fadedd