The patch titled drivers/spi: move a dereference below a NULL test has been added to the -mm tree. Its filename is drivers-spi-move-a-dereference-below-a-null-test.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: drivers/spi: move a dereference below a NULL test From: Julia Lawall <julia@xxxxxxx> In each case, if the NULL test is necessary, then the dereference should be moved below the NULL test. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ type T; expression E; identifier i,fld; statement S; @@ - T i = E->fld; + T i; ... when != E when != i if (E == NULL) S + i = E->fld; // </smpl> Signed-off-by: Julia Lawall <julia@xxxxxxx> Acked-by: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/spi/pxa2xx_spi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff -puN drivers/spi/pxa2xx_spi.c~drivers-spi-move-a-dereference-below-a-null-test drivers/spi/pxa2xx_spi.c --- a/drivers/spi/pxa2xx_spi.c~drivers-spi-move-a-dereference-below-a-null-test +++ a/drivers/spi/pxa2xx_spi.c @@ -1561,11 +1561,12 @@ out_error_master_alloc: static int pxa2xx_spi_remove(struct platform_device *pdev) { struct driver_data *drv_data = platform_get_drvdata(pdev); - struct ssp_device *ssp = drv_data->ssp; + struct ssp_device *ssp; int status = 0; if (!drv_data) return 0; + ssp = drv_data->ssp; /* Remove the queue */ status = destroy_queue(drv_data); _ Patches currently in -mm which might be from julia@xxxxxxx are origin.patch linux-next.patch arch-avr32-eliminate-null-test-and-memset-after-alloc_bootmem.patch powerpc-powermac-add-missing-of_node_put.patch net-tipc-bcasth-use-array_size.patch fs-namespacec-drop-code-after-return.patch mm-page_allocc-eliminate-null-test-and-memset-after-alloc_bootmem.patch drivers-macintosh-add-missing-of_node_put-in-therm_adt746xc.patch drivers-rtc-correct-an-error-test.patch drivers-isdn-hardware-misdn-move-a-dereference-below-a-null-test.patch drivers-mmc-move-a-dereference-below-a-null-test.patch drivers-net-hamradio-6packc-move-a-dereference-below-a-null-test.patch drivers-net-wireless-libertas-move-a-dereference-below-a-null-test.patch drivers-scsi-move-a-dereference-below-a-null-test.patch drivers-spi-move-a-dereference-below-a-null-test.patch net-bridge-netfilter-move-a-dereference-below-a-null-test.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html