You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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:
committed by
Greg Kroah-Hartman
parent
ad463ac427
commit
78110bb8dc
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user