@@ -821,8 +821,8 @@ static void ttusb_dec_process_urb(struct urb *urb)
b = urb->transfer_buffer + d->offset;
length = d->actual_length;
- if ((frame = kmalloc(sizeof(struct urb_frame),
- GFP_ATOMIC))) {
+ frame = kmalloc(sizeof(*frame), GFP_ATOMIC);
+ if (frame) {
unsigned long flags;
memcpy(frame->data, b, length);
@@ -1073,8 +1073,8 @@ static int ttusb_dec_start_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
if (!result) {
if (c_length == 2) {
- if (!(finfo = kmalloc(sizeof(struct filter_info),
- GFP_ATOMIC)))
+ finfo = kmalloc(sizeof(*finfo), GFP_ATOMIC);
+ if (!finfo)
return -ENOMEM;
finfo->stream_id = c[1];
@@ -1658,7 +1658,8 @@ static int ttusb_dec_probe(struct usb_interface *intf,
udev = interface_to_usbdev(intf);
- if (!(dec = kzalloc(sizeof(struct ttusb_dec), GFP_KERNEL))) {
+ dec = kzalloc(sizeof(*dec), GFP_KERNEL);
+ if (!dec) {
printk("%s: couldn't allocate memory.\n", __func__);
return -ENOMEM;
}