staging: Remove unnecessary OOM messages

alloc failures already get standardized OOM
messages and a dump_stack.

For the affected mallocs around these OOM messages:

Converted kzallocs with multiplies to kcalloc.
Converted kmallocs with multiplies to kmalloc_array.
Converted a kmalloc/strlen/strncpy to kstrdup.
Moved a spin_lock below a removed OOM message and
removed a now unnecessary spin_unlock.
Neatened alignment and whitespace.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Joe Perches
2013-02-11 09:41:29 -08:00
committed by Greg Kroah-Hartman
parent ad463ac427
commit 78110bb8dc
53 changed files with 143 additions and 376 deletions
@@ -222,7 +222,6 @@ static int pio2_probe(struct vme_dev *vdev)
card = kzalloc(sizeof(struct pio2_card), GFP_KERNEL);
if (card == NULL) {
dev_err(&vdev->dev, "Unable to allocate card structure\n");
retval = -ENOMEM;
goto err_struct;
}
+1 -3
View File
@@ -192,10 +192,8 @@ int pio2_gpio_init(struct pio2_card *card)
char *label;
label = kmalloc(PIO2_NUM_CHANNELS, GFP_KERNEL);
if (label == NULL) {
dev_err(&card->vdev->dev, "Unable to allocate GPIO label\n");
if (label == NULL)
return -ENOMEM;
}
sprintf(label, "%s@%s", driver_name, dev_name(&card->vdev->dev));
card->gc.label = label;
-2
View File
@@ -761,8 +761,6 @@ static int vme_user_probe(struct vme_dev *vdev)
image[i].size_buf = PCI_BUF_SIZE;
image[i].kern_buf = kmalloc(image[i].size_buf, GFP_KERNEL);
if (image[i].kern_buf == NULL) {
dev_warn(&vdev->dev,
"Unable to allocate memory for master window buffers\n");
err = -ENOMEM;
goto err_master_buf;
}