@@ -1657,7 +1657,8 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i
if (intf->altsetting->desc.bInterfaceNumber != 1) return -ENODEV;
- if (!(ttusb = kzalloc(sizeof(struct ttusb), GFP_KERNEL)))
+ ttusb = kzalloc(sizeof(*ttusb), GFP_KERNEL);
+ if (!ttusb)
return -ENOMEM;
ttusb->dev = udev;
@@ -1692,7 +1693,7 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i
ttusb->adapter.priv = ttusb;
/* i2c */
- memset(&ttusb->i2c_adap, 0, sizeof(struct i2c_adapter));
+ memset(&ttusb->i2c_adap, 0, sizeof(ttusb->i2c_adap));
strcpy(ttusb->i2c_adap.name, "TTUSB DEC");
i2c_set_adapdata(&ttusb->i2c_adap, ttusb);