Input: use kzalloc() throughout the code
[linux-drm-fsl-dcu.git] / drivers / input / mouse / hil_ptr.c
index c2bf2ed07dc6937aa8cbb98171d6b9021e4a577a..798f4a3ad7d23c2972fa9986ffb4dced5a3e5f6b 100644 (file)
@@ -245,10 +245,11 @@ static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver)
        unsigned int    i, naxsets, btntype;
        uint8_t         did, *idd;
 
-       if (!(ptr = kmalloc(sizeof(struct hil_ptr), GFP_KERNEL))) return -ENOMEM;
-       memset(ptr, 0, sizeof(struct hil_ptr));
+       if (!(ptr = kzalloc(sizeof(struct hil_ptr), GFP_KERNEL)))
+               return -ENOMEM;
 
-       if (serio_open(serio, driver)) goto bail0;
+       if (serio_open(serio, driver))
+               goto bail0;
 
        serio_set_drvdata(serio, ptr);
        ptr->serio = serio;