atm: Adjustments for adummy_init()
Subsystems (4)
cover atm: Adjustments for adummy_init()
From: Markus Elfring <[email protected]>
Date: Sun, 1 Oct 2017 21:43:21 +0200
Two update suggestions were taken into account
from static source code analysis.
Markus Elfring (2):
Delete an error message for a failed memory allocation Improve a size determination
drivers/atm/adummy.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
Signature · 1 line
2.14.2
PATCH 1/2 atm: Delete an error message for a failed memory allocation in adummy_init()
From: Markus Elfring <[email protected]>
Date: Sun, 1 Oct 2017 21:31:32 +0200
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
--- drivers/atm/adummy.c | 1 - 1 file changed, 1 deletion(-)
drivers/atm/adummy.c +0 -1
@@ -150,7 +150,6 @@ static int __init adummy_init(void) adummy_dev =kzalloc (sizeof (struct adummy_dev ),GFP_KERNEL );if (!adummy_dev) { - printk(KERN_ERR DEV_LABEL ": kzalloc() failed\n"); err = -ENOMEM ; goto out; }
Signature · 1 line
2.14.2
PATCH 2/2 atm: Improve a size determination in adummy_init()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Sun, 1 Oct 2017 21:35:18 +0200
Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention.
This issue was detected by using the Coccinelle software.
--- drivers/atm/adummy.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/atm/adummy.c +1 -3
@@ -146,9 +146,7 @@ static int __init adummy_init(void)int err =0 ;printk (KERN_ERR "adummy: version %s\n" ,DRV_VERSION ); - - adummy_dev =kzalloc (sizeof (struct adummy_dev ), -GFP_KERNEL ); + adummy_dev =kzalloc (sizeof (*adummy_dev),GFP_KERNEL );if (!adummy_dev) { err = -ENOMEM ; goto out;
Signature · 1 line
2.14.2