Skip to content

Commit

Permalink
[BBC_ENVCTRL]: kmalloc + memset conversion to kzalloc
Browse files Browse the repository at this point in the history
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Mariusz Kozlowski authored and David S. Miller committed Jul 31, 2007
1 parent da4e9fe commit 916e89f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/sbus/char/bbc_envctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,11 +479,12 @@ static int kenvctrld(void *__unused)

static void attach_one_temp(struct linux_ebus_child *echild, int temp_idx)
{
struct bbc_cpu_temperature *tp = kmalloc(sizeof(*tp), GFP_KERNEL);
struct bbc_cpu_temperature *tp;

tp = kzalloc(sizeof(*tp), GFP_KERNEL);
if (!tp)
return;
memset(tp, 0, sizeof(*tp));

tp->client = bbc_i2c_attach(echild);
if (!tp->client) {
kfree(tp);
Expand Down Expand Up @@ -525,11 +526,12 @@ static void attach_one_temp(struct linux_ebus_child *echild, int temp_idx)

static void attach_one_fan(struct linux_ebus_child *echild, int fan_idx)
{
struct bbc_fan_control *fp = kmalloc(sizeof(*fp), GFP_KERNEL);
struct bbc_fan_control *fp;

fp = kzalloc(sizeof(*fp), GFP_KERNEL);
if (!fp)
return;
memset(fp, 0, sizeof(*fp));

fp->client = bbc_i2c_attach(echild);
if (!fp->client) {
kfree(fp);
Expand Down

0 comments on commit 916e89f

Please sign in to comment.