Category: Linux

ehea: Introduce the use of the managed version of kzalloc

Author: Himangi Saraogi <himangi774@gmail.com> This patch moves data allocated using kzalloc to managed data allocated using devm_kzalloc and cleans now unnecessary kfrees in probe and remove functions. Also, linux/device.h is added to make sure the devm_*() routine declarations are unambiguously available. The following Coccinelle semantic patch was used for making the change: @platform@ identifier p, …

Continue reading

md: md_clear_badblocks should return an error code on failure.

Author: NeilBrown <neilb@suse.de> Julia Lawall and coccinelle report that md_clear_badblocks always returns 0, despite appearing to have an error path. The error path really should return an error code. ENOSPC is reasonably appropriate. Reported-by: Julia Lawall Signed-off-by: NeilBrown — drivers/md/md.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   diff –git a/drivers/md/md.c b/drivers/md/md.c …

Continue reading

crypto: caam – Introduce the use of the managed version of kzalloc

Author: Himangi Saraogi <himangi774@gmail.com> This patch moves data allocated using kzalloc to managed data allocated using devm_kzalloc and cleans now unnecessary kfrees in probe and remove functions. Also, linux/device.h is added to make sure the devm_*() routine declarations are unambiguously available. Earlier, in the probe function ctrlpriv was leaked on the failure of ctrl = …

Continue reading

display7seg: Introduce the use of the managed version of kzalloc

Author: Himangi Saraogi <himangi774@gmail.com> This patch moves data allocated using kzalloc to managed data allocated using devm_kzalloc and cleans now unnecessary kfrees in probe and remove functions. The header file is added to make the devm function explicitly available. The following Coccinelle semantic patch was used for making a part of the change: @platform@ identifier …

Continue reading

powerpc: Introduce the use of the managed version of kzalloc

Author: Himangi Saraogi <himangi774@gmail.com> This patch moves data allocated using kzalloc to managed data allocated using devm_kzalloc and cleans now unnecessary kfree in probe function. The following Coccinelle semantic patch was used for making the change: @platform@ identifier p, probefn, removefn; @@ struct platform_driver p = { .probe = probefn, .remove = removefn, }; @prb@ …

Continue reading

pinctrl: pinconf-generic: Use kmemdup instead of kmalloc + memcpy

Author: Benoit Taine <benoit.taine@lip6.fr> This issue was reported by coccicheck using the semantic patch at scripts/coccinelle/api/memdup.cocci Signed-off-by: Benoit Taine Signed-off-by: Linus Walleij — drivers/pinctrl/pinconf-generic.c | 3 +– 1 file changed, 1 insertion(+), 2 deletions(-)   diff –git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c index 3d9a999..2457ca9 100644 — a/drivers/pinctrl/pinconf-generic.c +++ b/drivers/pinctrl/pinconf-generic.c @@ -228,13 +228,12 @@ int pinconf_generic_parse_dt_config(struct device_node *np, * …

Continue reading

[media] drx-j: Use kmemdup instead of kmalloc + memcpy

Author: Benoit Taine <benoit.taine@lip6.fr> This issue was reported by coccicheck using the semantic patch at scripts/coccinelle/api/memdup.cocci Signed-off-by: Benoit Taine Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab — drivers/media/dvb-frontends/drx39xyj/drxj.c | 14 ++++++——– 1 file changed, 6 insertions(+), 8 deletions(-)   diff –git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c index 9482954..3795f65 100644 — a/drivers/media/dvb-frontends/drx39xyj/drxj.c +++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c @@ -12272,22 +12272,20 @@ struct …

Continue reading

HID: uhid: Use kmemdup instead of kmalloc + memcpy

Author: Benoit Taine <benoit.taine@lip6.fr> This issue was reported by coccicheck using the semantic patch at scripts/coccinelle/api/memdup.cocci Signed-off-by: Benoit Taine Reviewed-by: David Herrmann Signed-off-by: Jiri Kosina — drivers/hid/uhid.c | 5 ++— 1 file changed, 2 insertions(+), 3 deletions(-)   diff –git a/drivers/hid/uhid.c b/drivers/hid/uhid.c index 0d078c3..0cb92e3 100644 — a/drivers/hid/uhid.c +++ b/drivers/hid/uhid.c @@ -441,12 +441,11 @@ static int …

Continue reading

r8152: Use kmemdup instead of kmalloc + memcpy

Author: Benoit Taine <benoit.taine@lip6.fr> This issue was reported by coccicheck using the semantic patch at scripts/coccinelle/api/memdup.cocci Signed-off-by: Benoit Taine Signed-off-by: David S. Miller — drivers/net/usb/r8152.c | 4 +— 1 file changed, 1 insertion(+), 3 deletions(-)   diff –git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 9f91c7a..2543196 100644 — a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -630,12 +630,10 @@ int set_registers(struct r8152 *tp, …

Continue reading

drm/edid: Use kmemdup instead of kmalloc + memcpy

Author: Benoit Taine <benoit.taine@lip6.fr> This issue was reported by coccicheck using the semantic patch at scripts/coccinelle/api/memdup.cocci Signed-off-by: Benoit Taine Signed-off-by: Dave Airlie — drivers/gpu/drm/drm_edid.c | 3 +– 1 file changed, 1 insertion(+), 2 deletions(-)   diff –git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 7a4fd2e..d74239f 100644 — a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3228,10 +3228,9 @@ int drm_edid_to_speaker_allocation(struct edid *edid, u8 …

Continue reading