diff options
author | Burman Yan <yan_952@hotmail.com> | 2007-02-14 03:33:07 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-14 11:09:52 -0500 |
commit | 8f31bb39ec2a5622974666c72257e74c22492602 (patch) | |
tree | 48f38c994f02c8699fe2a69599e8cc1bc8d36ea8 /drivers/serial/jsm/jsm_driver.c | |
parent | 3689a0ec60bc8f56cc372c1dfa0d89dab48f7c9c (diff) |
[PATCH] serial: replace kmalloc+memset with kzalloc
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/serial/jsm/jsm_driver.c')
-rw-r--r-- | drivers/serial/jsm/jsm_driver.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/serial/jsm/jsm_driver.c b/drivers/serial/jsm/jsm_driver.c index 244f63be3a03..81792e6eeb2d 100644 --- a/drivers/serial/jsm/jsm_driver.c +++ b/drivers/serial/jsm/jsm_driver.c | |||
@@ -71,14 +71,13 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
71 | goto out_disable_device; | 71 | goto out_disable_device; |
72 | } | 72 | } |
73 | 73 | ||
74 | brd = kmalloc(sizeof(struct jsm_board), GFP_KERNEL); | 74 | brd = kzalloc(sizeof(struct jsm_board), GFP_KERNEL); |
75 | if (!brd) { | 75 | if (!brd) { |
76 | dev_err(&pdev->dev, | 76 | dev_err(&pdev->dev, |
77 | "memory allocation for board structure failed\n"); | 77 | "memory allocation for board structure failed\n"); |
78 | rc = -ENOMEM; | 78 | rc = -ENOMEM; |
79 | goto out_release_regions; | 79 | goto out_release_regions; |
80 | } | 80 | } |
81 | memset(brd, 0, sizeof(struct jsm_board)); | ||
82 | 81 | ||
83 | /* store the info for the board we've found */ | 82 | /* store the info for the board we've found */ |
84 | brd->boardnum = adapter_count++; | 83 | brd->boardnum = adapter_count++; |
@@ -152,7 +151,7 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
152 | * Okay to malloc with GFP_KERNEL, we are not at interrupt | 151 | * Okay to malloc with GFP_KERNEL, we are not at interrupt |
153 | * context, and there are no locks held. | 152 | * context, and there are no locks held. |
154 | */ | 153 | */ |
155 | brd->flipbuf = kmalloc(MYFLIPLEN, GFP_KERNEL); | 154 | brd->flipbuf = kzalloc(MYFLIPLEN, GFP_KERNEL); |
156 | if (!brd->flipbuf) { | 155 | if (!brd->flipbuf) { |
157 | /* XXX: leaking all resources from jsm_tty_init and | 156 | /* XXX: leaking all resources from jsm_tty_init and |
158 | jsm_uart_port_init here! */ | 157 | jsm_uart_port_init here! */ |
@@ -160,7 +159,6 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
160 | retval = -ENOMEM; | 159 | retval = -ENOMEM; |
161 | goto out_free_irq; | 160 | goto out_free_irq; |
162 | } | 161 | } |
163 | memset(brd->flipbuf, 0, MYFLIPLEN); | ||
164 | 162 | ||
165 | pci_set_drvdata(pdev, brd); | 163 | pci_set_drvdata(pdev, brd); |
166 | 164 | ||