]> err.no Git - linux-2.6/blobdiff - drivers/isdn/hisax/hisax_fcpcipnp.c
Pull thermal into release branch
[linux-2.6] / drivers / isdn / hisax / hisax_fcpcipnp.c
index f6db55a752c4e6deb2395be3259d1400234bc70a..7993e01f9fc5cd08e22e0caac469e7208b2e3930 100644 (file)
@@ -841,12 +841,10 @@ new_adapter(void)
        struct hisax_b_if *b_if[2];
        int i;
 
-       adapter = kmalloc(sizeof(struct fritz_adapter), GFP_KERNEL);
+       adapter = kzalloc(sizeof(struct fritz_adapter), GFP_KERNEL);
        if (!adapter)
                return NULL;
 
-       memset(adapter, 0, sizeof(struct fritz_adapter));
-
        adapter->isac.hisax_d_if.owner = THIS_MODULE;
        adapter->isac.hisax_d_if.ifc.priv = &adapter->isac;
        adapter->isac.hisax_d_if.ifc.l2l1 = isac_d_l2l1;
@@ -861,7 +859,11 @@ new_adapter(void)
        for (i = 0; i < 2; i++)
                b_if[i] = &adapter->bcs[i].b_if;
 
-       hisax_register(&adapter->isac.hisax_d_if, b_if, "fcpcipnp", protocol);
+       if (hisax_register(&adapter->isac.hisax_d_if, b_if, "fcpcipnp",
+                       protocol) != 0) {
+               kfree(adapter);
+               adapter = NULL;
+       }
 
        return adapter;
 }