From: Ira Weiny <ira.we...@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.we...@intel.com>
---
 drivers/staging/rdma/hfi1/diag.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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))
-- 
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to