aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/sx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/sx.c')
-rw-r--r--drivers/char/sx.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/char/sx.c b/drivers/char/sx.c
index 5e01337e6107..5fb79f59040f 100644
--- a/drivers/char/sx.c
+++ b/drivers/char/sx.c
@@ -2267,18 +2267,6 @@ static int sx_init_drivers(void)
2267 return 0; 2267 return 0;
2268} 2268}
2269 2269
2270
2271static void * ckmalloc (int size)
2272{
2273 void *p;
2274
2275 p = kmalloc(size, GFP_KERNEL);
2276 if (p)
2277 memset(p, 0, size);
2278 return p;
2279}
2280
2281
2282static int sx_init_portstructs (int nboards, int nports) 2270static int sx_init_portstructs (int nboards, int nports)
2283{ 2271{
2284 struct sx_board *board; 2272 struct sx_board *board;
@@ -2291,7 +2279,7 @@ static int sx_init_portstructs (int nboards, int nports)
2291 2279
2292 /* Many drivers statically allocate the maximum number of ports 2280 /* Many drivers statically allocate the maximum number of ports
2293 There is no reason not to allocate them dynamically. Is there? -- REW */ 2281 There is no reason not to allocate them dynamically. Is there? -- REW */
2294 sx_ports = ckmalloc(nports * sizeof (struct sx_port)); 2282 sx_ports = kcalloc(nports, sizeof(struct sx_port), GFP_KERNEL);
2295 if (!sx_ports) 2283 if (!sx_ports)
2296 return -ENOMEM; 2284 return -ENOMEM;
2297 2285