aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMariusz Kozlowski <m.kozlowski@tuxland.pl>2007-07-31 17:04:19 -0400
committerDavid S. Miller <davem@davemloft.net>2007-07-31 17:04:19 -0400
commit916e89fdd1b21eec4abbc9e228757db77660fff2 (patch)
treedfbf049f85144b5a973f099a0e390cffed936ca7
parentda4e9fea85ea42c9c6ce163a85d5164efbec31a2 (diff)
[BBC_ENVCTRL]: kmalloc + memset conversion to kzalloc
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/sbus/char/bbc_envctrl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/sbus/char/bbc_envctrl.c b/drivers/sbus/char/bbc_envctrl.c
index e821a155b658..0bde26989a23 100644
--- a/drivers/sbus/char/bbc_envctrl.c
+++ b/drivers/sbus/char/bbc_envctrl.c
@@ -479,11 +479,12 @@ static int kenvctrld(void *__unused)
479 479
480static void attach_one_temp(struct linux_ebus_child *echild, int temp_idx) 480static void attach_one_temp(struct linux_ebus_child *echild, int temp_idx)
481{ 481{
482 struct bbc_cpu_temperature *tp = kmalloc(sizeof(*tp), GFP_KERNEL); 482 struct bbc_cpu_temperature *tp;
483 483
484 tp = kzalloc(sizeof(*tp), GFP_KERNEL);
484 if (!tp) 485 if (!tp)
485 return; 486 return;
486 memset(tp, 0, sizeof(*tp)); 487
487 tp->client = bbc_i2c_attach(echild); 488 tp->client = bbc_i2c_attach(echild);
488 if (!tp->client) { 489 if (!tp->client) {
489 kfree(tp); 490 kfree(tp);
@@ -525,11 +526,12 @@ static void attach_one_temp(struct linux_ebus_child *echild, int temp_idx)
525 526
526static void attach_one_fan(struct linux_ebus_child *echild, int fan_idx) 527static void attach_one_fan(struct linux_ebus_child *echild, int fan_idx)
527{ 528{
528 struct bbc_fan_control *fp = kmalloc(sizeof(*fp), GFP_KERNEL); 529 struct bbc_fan_control *fp;
529 530
531 fp = kzalloc(sizeof(*fp), GFP_KERNEL);
530 if (!fp) 532 if (!fp)
531 return; 533 return;
532 memset(fp, 0, sizeof(*fp)); 534
533 fp->client = bbc_i2c_attach(echild); 535 fp->client = bbc_i2c_attach(echild);
534 if (!fp->client) { 536 if (!fp->client) {
535 kfree(fp); 537 kfree(fp);