Category: Linux

watchdog: move the dereference below the NULL test

Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn> The dereference should be moved below the NULL test. spatch with a semantic match is used to found this. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun Signed-off-by: Wim Van Sebroeck — drivers/watchdog/watchdog_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)   diff –git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c index 6aa46a9..3796434 100644 — a/drivers/watchdog/watchdog_core.c +++ b/drivers/watchdog/watchdog_core.c …

Continue reading

caif: move the dereference below the NULL test

Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn> The dereference should be moved below the NULL test. spatch with a semantic match is used to found this. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller — net/caif/cfsrvl.c | 5 +++– 1 file changed, 3 insertions(+), 2 deletions(-)   diff –git a/net/caif/cfsrvl.c b/net/caif/cfsrvl.c index dd485f6..ba217e9 100644 — a/net/caif/cfsrvl.c +++ b/net/caif/cfsrvl.c …

Continue reading

cciss: remove unneeded memset()

Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn> The memory return by kzalloc() or kmem_cache_zalloc() has already be set to zero, so remove useless memset(0). spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun Cc: Mike Miller Cc: Jens Axboe Cc: Stephen M. Cameron Signed-off-by: Andrew Morton Signed-off-by: Jens Axboe — drivers/block/cciss.c | …

Continue reading

NFC: Move the pn544_hci dereference below the NULL test

Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn> The dereference should be moved below the NULL test. spatch with a semantic match is used to found this. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun Signed-off-by: Samuel Ortiz — drivers/nfc/pn544_hci.c | 9 ++++++— 1 file changed, 6 insertions(+), 3 deletions(-)   diff –git a/drivers/nfc/pn544_hci.c b/drivers/nfc/pn544_hci.c index e681da2..7b0c217 100644 — a/drivers/nfc/pn544_hci.c +++ b/drivers/nfc/pn544_hci.c @@ …

Continue reading

[media] drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c: fix error return code

Author: Peter Senna Tschudin <peter.senna@gmail.com> Convert a nonnegative error return code to a negative one, as returned elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... …

Continue reading

NFC: Move the nfcwilink dereference below the NULL test

Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn> spatch with a semantic match is used to found this. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun Signed-off-by: Samuel Ortiz — drivers/nfc/nfcwilink.c | 4 ++– 1 file changed, 2 insertions(+), 2 deletions(-)   diff –git a/drivers/nfc/nfcwilink.c b/drivers/nfc/nfcwilink.c index 827f039..50b1ee4 100644 — a/drivers/nfc/nfcwilink.c +++ b/drivers/nfc/nfcwilink.c @@ -352,8 +352,6 @@ static long nfcwilink_receive(void *priv_data, struct sk_buff …

Continue reading

Bluetooth: btuart_cs.c: removes unnecessary semicolon

Author: Peter Senna Tschudin <peter.senna@gmail.com> removes unnecessary semicolon Found by Coccinelle: http://coccinelle.lip6.fr/ Signed-off-by: Peter Senna Tschudin Acked-by: Marcel Holtmann Signed-off-by: Gustavo Padovan — drivers/bluetooth/btuart_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   diff –git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c index 2f510a8..35a553a 100644 — a/drivers/bluetooth/btuart_cs.c +++ b/drivers/bluetooth/btuart_cs.c @@ -446,7 +446,7 @@ static int btuart_hci_send_frame(struct sk_buff *skb) …

Continue reading

Bluetooth: hci_vhci.c: removes unnecessary semicolon

Author: Peter Senna Tschudin <peter.senna@gmail.com> removes unnecessary semicolon Found by Coccinelle: http://coccinelle.lip6.fr/ Signed-off-by: Peter Senna Tschudin Acked-by: Marcel Holtmann Signed-off-by: Gustavo Padovan — drivers/bluetooth/hci_vhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   diff –git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c index 3f72595..d8b7aed 100644 — a/drivers/bluetooth/hci_vhci.c +++ b/drivers/bluetooth/hci_vhci.c @@ -156,7 +156,7 @@ static inline ssize_t vhci_put_user(struct vhci_data …

Continue reading

Bluetooth: hci_ll.c: removes unnecessary semicolon

Author: Peter Senna Tschudin <peter.senna@gmail.com> removes unnecessary semicolon Found by Coccinelle: http://coccinelle.lip6.fr/ Signed-off-by: Peter Senna Tschudin Acked-by: Marcel Holtmann Signed-off-by: Gustavo Padovan — drivers/bluetooth/hci_ll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   diff –git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c index ff6d589..cfc7679 100644 — a/drivers/bluetooth/hci_ll.c +++ b/drivers/bluetooth/hci_ll.c @@ -481,7 +481,7 @@ static int ll_recv(struct hci_uart *hu, …

Continue reading

drivers/net/wireless/ath/ath9k/ar9003_mac.c: removes unnecessary semicolon

Author: Peter Senna Tschudin <peter.senna@gmail.com> removes unnecessary semicolon Found by Coccinelle: http://coccinelle.lip6.fr/ Signed-off-by: Peter Senna Tschudin Signed-off-by: John W. Linville — drivers/net/wireless/ath/ath9k/ar9003_mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   diff –git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c index 78816b8..5d55724 100644 — a/drivers/net/wireless/ath/ath9k/ar9003_mac.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c @@ -531,7 +531,7 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs, …

Continue reading