diff options
Diffstat (limited to 'drivers/staging/usbip')
-rw-r--r-- | drivers/staging/usbip/stub_rx.c | 4 | ||||
-rw-r--r-- | drivers/staging/usbip/vhci_sysfs.c | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/drivers/staging/usbip/stub_rx.c b/drivers/staging/usbip/stub_rx.c index 2eb61372fe0..1c710628df0 100644 --- a/drivers/staging/usbip/stub_rx.c +++ b/drivers/staging/usbip/stub_rx.c @@ -334,7 +334,7 @@ static struct stub_priv *stub_priv_alloc(struct stub_device *sdev, spin_lock_irqsave(&sdev->priv_lock, flags); - priv = kmem_cache_alloc(stub_priv_cache, GFP_ATOMIC); + priv = kmem_cache_zalloc(stub_priv_cache, GFP_ATOMIC); if (!priv) { dev_err(&sdev->interface->dev, "alloc stub_priv\n"); spin_unlock_irqrestore(&sdev->priv_lock, flags); @@ -342,8 +342,6 @@ static struct stub_priv *stub_priv_alloc(struct stub_device *sdev, return NULL; } - memset(priv, 0, sizeof(struct stub_priv)); - priv->seqnum = pdu->base.seqnum; priv->sdev = sdev; diff --git a/drivers/staging/usbip/vhci_sysfs.c b/drivers/staging/usbip/vhci_sysfs.c index 0fd33a62d93..e4c71435aa1 100644 --- a/drivers/staging/usbip/vhci_sysfs.c +++ b/drivers/staging/usbip/vhci_sysfs.c @@ -31,8 +31,7 @@ static ssize_t show_status(struct device *dev, struct device_attribute *attr, char *s = out; int i = 0; - if (!the_controller || !out) - BUG(); + BUG_ON(!the_controller || !out); spin_lock(&the_controller->lock); |