aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2009-05-20 03:17:11 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-06-19 14:00:53 -0400
commita3d97c9b192df8e9c6a041f9452b400070ce2d02 (patch)
treefa30fadf622408b9ab6b0a56987c66f3bd232c27
parent562bf4845fbd9240a1964734d769bb5f6973e759 (diff)
Staging: cpc-usb: Adjust NULL test
Since card must already be non-NULL, it seems that what was intended was to test the result of kmalloc. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ expression E,E1; identifier f,fld,fld1; statement S1,S2; @@ E->fld = f(...); ... when != E = E1 when != E->fld1 = E1 if ( - E + E->fld == NULL) S1 else S2 // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/cpc-usb/cpc-usb_drv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/cpc-usb/cpc-usb_drv.c b/drivers/staging/cpc-usb/cpc-usb_drv.c
index 14aca399fc4c..672f7866a69c 100644
--- a/drivers/staging/cpc-usb/cpc-usb_drv.c
+++ b/drivers/staging/cpc-usb/cpc-usb_drv.c
@@ -899,7 +899,7 @@ static int cpcusb_probe(struct usb_interface *interface,
899 899
900 /* allocate and initialize the channel struct */ 900 /* allocate and initialize the channel struct */
901 card->chan = kmalloc(sizeof(CPC_CHAN_T), GFP_KERNEL); 901 card->chan = kmalloc(sizeof(CPC_CHAN_T), GFP_KERNEL);
902 if (!card) { 902 if (!card->chan) {
903 kfree(card); 903 kfree(card);
904 err("Out of memory"); 904 err("Out of memory");
905 return -ENOMEM; 905 return -ENOMEM;