/// NULL check before some freeing functions is not needed. /// /// Based on checkpatch warning /// "kfree(NULL) is safe this check is probably not required" /// and kfreeaddr.cocci by Julia Lawall. /// // Copyright: (C) 2014 Fabian Frederick. GPLv2. // Comments: - // Options: --no-includes --include-headers virtual patch virtual org virtual report virtual context @r2 depends on patch@ expression E; @@ - if (E != NULL) ( kfree(E); | kzfree(E); | debugfs_remove(E); | debugfs_remove_recursive(E); | usb_free_urb(E); | kmem_cache_destroy(E); | mempool_destroy(E); | dma_pool_destroy(E); ) @r depends on context || report || org @ expression E; position p; @@ * if (E != NULL) * \(kfree@p\|kzfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\| * usb_free_urb@p\|kmem_cache_destroy@p\|mempool_destroy@p\| * dma_pool_destroy@p\)(E); @script:python depends on org@ p << r.p; @@ cocci.print_main("NULL check before that freeing function is not needed", p) @script:python depends on report@ p << r.p; @@ msg = "WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values." coccilib.report.print_report(p[0], msg) t> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-02-06can: flexcan: flexcan_poll_bus_err(): fold in do_bus_err()Marc Kleine-Budde1-14/+7
This patch folds in the do_bus_err() function into flexcan_poll_bus_err(). Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-02-06can: flexcan: flexcan_poll_state(): no need to initialize new_state, ↵Marc Kleine-Budde1-1/+1
rx_state, tx_state This patch removed the not needed initialisation from the new_state, rx_state, tx_state variabled. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-02-06can: flexcan: do_bus_err(): convert rx_,tx_errors into boolMarc Kleine-Budde1-7/+7
This patch converts the rx_errors and tx_errors from int into bool values, to reflect their actual meaning. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-02-06can: flexcan: make declaration of devtype_data constMarc Kleine-Budde1-4/+4
This patch changes the declaration of the devtype data to const. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-02-06can: flexcan: remove write-only member pdata of struct flexcan_privMarc Kleine-Budde1-2/+0
This patch removes the write only member pdata from the struct flexcan_priv. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-02-06can: flexcan: add missing register definitionsMarc Kleine-Budde1-3/+10
This patch adds some missing register definitions, which are needed in an upcoming patch. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-02-06can: rx-offload: Add support for timestamp based irq offloadingMarc Kleine-Budde