Commit 916e89fd authored by Mariusz Kozlowski's avatar Mariusz Kozlowski Committed by David S. Miller

[BBC_ENVCTRL]: kmalloc + memset conversion to kzalloc

Signed-off-by: default avatarMariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent da4e9fea
......@@ -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);
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment