aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/mon
diff options
context:
space:
mode:
authorEric Sesterhenn <snakebyte@gmx.de>2006-02-27 15:29:43 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-20 17:49:59 -0500
commit80b6ca48321974a6566a1c9048ba34f60420bca6 (patch)
treea350e3cf6b794081c13c89d5b1913b2c1207570d /drivers/usb/mon
parentd54a5cb6484705f7808b337917cc7598f2f971c3 (diff)
[PATCH] USB: kzalloc() conversion for rest of drivers/usb
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/mon')
-rw-r--r--drivers/usb/mon/mon_main.c3
-rw-r--r--drivers/usb/mon/mon_text.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/mon/mon_main.c b/drivers/usb/mon/mon_main.c
index b03e346e33f1..6ecc27302211 100644
--- a/drivers/usb/mon/mon_main.c
+++ b/drivers/usb/mon/mon_main.c
@@ -277,9 +277,8 @@ static void mon_bus_init(struct dentry *mondir, struct usb_bus *ubus)
277 char name[NAMESZ]; 277 char name[NAMESZ];
278 int rc; 278 int rc;
279 279
280 if ((mbus = kmalloc(sizeof(struct mon_bus), GFP_KERNEL)) == NULL) 280 if ((mbus = kzalloc(sizeof(struct mon_bus), GFP_KERNEL)) == NULL)
281 goto err_alloc; 281 goto err_alloc;
282 memset(mbus, 0, sizeof(struct mon_bus));
283 kref_init(&mbus->ref); 282 kref_init(&mbus->ref);
284 spin_lock_init(&mbus->lock); 283 spin_lock_init(&mbus->lock);
285 INIT_LIST_HEAD(&mbus->r_list); 284 INIT_LIST_HEAD(&mbus->r_list);
diff --git a/drivers/usb/mon/mon_text.c b/drivers/usb/mon/mon_text.c
index 59089e8b7e5e..ac043ec2b8dc 100644
--- a/drivers/usb/mon/mon_text.c
+++ b/drivers/usb/mon/mon_text.c
@@ -213,12 +213,11 @@ static int mon_text_open(struct inode *inode, struct file *file)
213 mbus = inode->u.generic_ip; 213 mbus = inode->u.generic_ip;
214 ubus = mbus->u_bus; 214 ubus = mbus->u_bus;
215 215
216 rp = kmalloc(sizeof(struct mon_reader_text), GFP_KERNEL); 216 rp = kzalloc(sizeof(struct mon_reader_text), GFP_KERNEL);
217 if (rp == NULL) { 217 if (rp == NULL) {
218 rc = -ENOMEM; 218 rc = -ENOMEM;
219 goto err_alloc; 219 goto err_alloc;
220 } 220 }
221 memset(rp, 0, sizeof(struct mon_reader_text));
222 INIT_LIST_HEAD(&rp->e_list); 221 INIT_LIST_HEAD(&rp->e_list);
223 init_waitqueue_head(&rp->wait); 222 init_waitqueue_head(&rp->wait);
224 mutex_init(&rp->printf_lock); 223 mutex_init(&rp->printf_lock);