Skip to contentSkip to conversation

staging: rdma: hfi1: Remove unnecessary kfree

PATCH New Amitoj Kaur Chawla 1 participant 1 message Feb 22, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rdma: hfi1: Remove unnecessary kfree

Remove an unnecessary kfree since rcd->opstats's value must be NULL for the code to execute bail label.

This fixes the following smatch warning:
drivers/staging/rdma/hfi1/init.c:335 hfi1_create_ctxtdata() warn:
calling kfree() when 'rcd->opstats' is always NULL.

---
 drivers/staging/rdma/hfi1/init.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/rdma/hfi1/init.c +0 -1
index 4dd8051..3107103 100644
@@ -332,7 +332,6 @@ struct hfi1_ctxtdata *hfi1_create_ctxtdata(struct hfi1_pportdata *ppd, u32 ctxt)
 	}
 	return rcd;
 bail:
-	kfree(rcd->opstats);
 	kfree(rcd->egrbufs.rcvtids);
 	kfree(rcd->egrbufs.buffers);
 	kfree(rcd);
Signature · 1 line
1.9.1