[patch 5/8] usb: use kzfree()
From: Johannes Weiner
Date: Mon Feb 16 2009 - 10:06:31 EST
Use kzfree() instead of memset() + kfree().
Signed-off-by: Johannes Weiner <hannes@xxxxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
drivers/usb/host/hwa-hc.c | 3 +--
drivers/usb/wusbcore/cbaf.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
--- a/drivers/usb/host/hwa-hc.c
+++ b/drivers/usb/host/hwa-hc.c
@@ -464,8 +464,7 @@ static int __hwahc_dev_set_key(struct wu
port_idx << 8 | iface_no,
keyd, keyd_len, 1000 /* FIXME: arbitrary */);
- memset(keyd, 0, sizeof(*keyd)); /* clear keys etc. */
- kfree(keyd);
+ kzfree(keyd);
return result;
}
--- a/drivers/usb/wusbcore/cbaf.c
+++ b/drivers/usb/wusbcore/cbaf.c
@@ -638,8 +638,7 @@ static void cbaf_disconnect(struct usb_i
usb_put_intf(iface);
kfree(cbaf->buffer);
/* paranoia: clean up crypto keys */
- memset(cbaf, 0, sizeof(*cbaf));
- kfree(cbaf);
+ kzfree(cbaf);
}
static struct usb_device_id cbaf_id_table[] = {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/