FC0012: Adjustments for fc0012_attach()
Subsystems (2)
cover FC0012: Adjustments for fc0012_attach()
From: Markus Elfring <[email protected]>
Date: Sat, 16 Sep 2017 18:03: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/media/tuners/fc0012.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Signature · 1 line
2.14.1
PATCH 1/2 fc0012: Delete an error message for a failed memory allocation in fc0012_attach()
From: Markus Elfring <[email protected]>
Date: Sat, 16 Sep 2017 17:47:52 +0200
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
--- drivers/media/tuners/fc0012.c | 1 - 1 file changed, 1 deletion(-)
drivers/media/tuners/fc0012.c +0 -1
@@ -449,6 +449,5 @@ struct dvb_frontend *fc0012_attach(struct dvb_frontend *fe,if (!priv) { ret = -ENOMEM ; -dev_err (&i2c->dev,"%s: kzalloc() failed\n" ,KBUILD_MODNAME ); goto err; }
Signature · 1 line
2.14.1
PATCH 2/2 fc0012: Improve a size determination in fc0012_attach()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Sat, 16 Sep 2017 17:55:27 +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/media/tuners/fc0012.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/tuners/fc0012.c +1 -1
@@ -445,5 +445,5 @@ struct dvb_frontend *fc0012_attach(struct dvb_frontend *fe,if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl (fe,1 ); - priv =kzalloc (sizeof (struct fc0012_priv ),GFP_KERNEL ); + priv =kzalloc (sizeof (*priv),GFP_KERNEL );if (!priv) {
Signature · 1 line
2.14.1