Category: Linux

usb: dwc3: keystone: fix error return code

Author: Julia Lawall <Julia.Lawall@lip6.fr> Return a negative error code on failure. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier ret; expression e1,e2; @@ ( if (\(ret < 0\|ret != 0\)) { ... return ret; } | ret = 0 ) ... when != ret = …

Continue reading

net: brcm80211: Deletion of unnecessary checks before two function calls

Author: Markus Elfring <elfring@users.sourceforge.net> The functions brcmu_pkt_buf_free_skb() and release_firmware() test whether their argument is NULL and then return immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Acked-by: Arend van Spriel Signed-off-by: John W. Linville — drivers/net/wireless/brcm80211/brcmfmac/firmware.c | 3 +– drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c | …

Continue reading

net: USB: Deletion of unnecessary checks before the function call “kfree”

Author: Markus Elfring <elfring@users.sourceforge.net> The kfree() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: David S. Miller — drivers/net/usb/asix_devices.c | 3 +– drivers/net/usb/hso.c | 3 +– 2 files changed, 2 …

Continue reading

net: Xilinx: Deletion of unnecessary checks before two function calls

Author: Markus Elfring <elfring@users.sourceforge.net> The functions kfree() and of_node_put() test whether their argument is NULL and then return immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Reviewed-by: Soren Brinkmann Signed-off-by: David S. Miller — drivers/net/ethernet/xilinx/ll_temac_main.c | 3 +– drivers/net/ethernet/xilinx/xilinx_emaclite.c | 3 …

Continue reading

IBM-EMAC: Deletion of unnecessary checks before the function call “of_dev_put”

Author: Markus Elfring <elfring@users.sourceforge.net> The of_dev_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: David S. Miller — drivers/net/ethernet/ibm/emac/core.c | 24 ++++++++—————- 1 file changed, 8 insertions(+), 16 deletions(-)   …

Continue reading

mtd: delete unnecessary checks before two function calls

Author: Markus Elfring <elfring@users.sourceforge.net> The functions kfree() and pci_dev_put() test whether their argument is NULL and then return immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Brian Norris — drivers/mtd/chips/cfi_cmdset_0001.c | 3 +– drivers/mtd/devices/pmc551.c | 3 +– 2 files changed, …

Continue reading

[media] USB: Deletion of unnecessary checks before three function calls

Author: Markus Elfring <elfring@users.sourceforge.net> GIT_AUTHOR_DATE=1416486805 The functions pvr2_hdw_destroy(), rc_unregister_device() and vfree() perform also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Mauro Carvalho Chehab — drivers/media/usb/au0828/au0828-input.c | 3 +– drivers/media/usb/em28xx/em28xx-input.c | 3 +– drivers/media/usb/pvrusb2/pvrusb2-context.c | 2 +- drivers/media/usb/s2255/s2255drv.c …

Continue reading

[media] rc: Deletion of unnecessary checks before two function calls

Author: Markus Elfring <elfring@users.sourceforge.net> The functions input_free_device() and rc_close() test whether their argument is NULL and then return immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Mauro Carvalho Chehab — drivers/media/rc/lirc_dev.c | 3 +– drivers/media/rc/rc-main.c | 3 +– 2 files …

Continue reading

[media] platform: Deletion of unnecessary checks before two function calls

Author: Markus Elfring <elfring@users.sourceforge.net> The functions i2c_put_adapter() and release_firmware() test whether their argument is NULL and then return immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Mauro Carvalho Chehab — drivers/media/platform/exynos4-is/fimc-is.c | 6 ++—- drivers/media/platform/s3c-camif/camif-core.c | 3 +– 2 files …

Continue reading

drivers: atm: eni: Add pci_dma_mapping_error() call

Author: Tina Johnson <tinajohnson.1234@gmail.com> Added a pci_dma_mapping_error() call to check for mapping errors before further using the dma handle. In case of error, control goes to a new label where the incoming skb is freed. Unchecked dma handles were found using Coccinelle: @rule1@ expression e1; identifier x; @@ *x = pci_map_single(…); … when != pci_dma_mapping_error(e1,x) …

Continue reading