[PATCH] power: fix noderef.cocci warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



drivers/power/pwrseq/pwrseq_generic.c:121:22-28: ERROR: application of sizeof to pointer

 sizeof when applied to a pointer typed expression gives the size of
 the pointer

Generated by: scripts/coccinelle/misc/noderef.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
---

 pwrseq_generic.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/power/pwrseq/pwrseq_generic.c
+++ b/drivers/power/pwrseq/pwrseq_generic.c
@@ -118,7 +118,7 @@ struct pwrseq *pwrseq_alloc_generic(void
 {
 	struct pwrseq_generic *pwrseq_gen;
 
-	pwrseq_gen = kzalloc(sizeof(pwrseq_gen), GFP_KERNEL);
+	pwrseq_gen = kzalloc(sizeof(*pwrseq_gen), GFP_KERNEL);
 	if (!pwrseq_gen)
 		return ERR_PTR(-ENOMEM);
 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux