diff mbox

[v3,07/13] staging/rdma/hfi1: diag.c correct sizeof parameter

Message ID 1449035018-26396-8-git-send-email-ira.weiny@intel.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Ira Weiny Dec. 2, 2015, 5:43 a.m. UTC
From: Ira Weiny <ira.weiny@intel.com>

sizeof should use the variable rather than the struct definition to ensure that
type changes are properly accounted for.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
 drivers/staging/rdma/hfi1/diag.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/staging/rdma/hfi1/diag.c b/drivers/staging/rdma/hfi1/diag.c
index efc0d2239311..a050e09699d8 100644
--- a/drivers/staging/rdma/hfi1/diag.c
+++ b/drivers/staging/rdma/hfi1/diag.c
@@ -1474,7 +1474,7 @@  static struct snoop_packet *allocate_snoop_packet(u32 hdr_len,
 {
 	struct snoop_packet *packet;
 
-	packet = kzalloc(sizeof(struct snoop_packet) + hdr_len + data_len
+	packet = kzalloc(sizeof(*packet) + hdr_len + data_len
 			 + md_len,
 			 GFP_ATOMIC | __GFP_NOWARN);
 	if (likely(packet))