aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);