From 71ae5255f8feaf16ab5a41db5db1c6a3d9c68665 Mon Sep 17 00:00:00 2001 From: Tomas Winkler Date: Thu, 23 Jul 2020 17:59:24 +0300 Subject: mei: bus: use sizeof of variable instead of struct type There is a possibility of bug when variable type has changed but corresponding struct passed to the sizeof has not. Cc: Gustavo A. R. Silva Reviewed-by: Gustavo A. R. Silva Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20200723145927.882743-4-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/misc/mei/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/misc/mei/bus.c') diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index f476dbc7252b..a6dfc3ce1db2 100644 --- a/drivers/misc/mei/bus.c +++ b/drivers/misc/mei/bus.c @@ -931,7 +931,7 @@ static struct mei_cl_device *mei_cl_bus_dev_alloc(struct mei_device *bus, struct mei_cl_device *cldev; struct mei_cl *cl; - cldev = kzalloc(sizeof(struct mei_cl_device), GFP_KERNEL); + cldev = kzalloc(sizeof(*cldev), GFP_KERNEL); if (!cldev) return NULL; -- cgit v1.2.3