diff options
| author | Joe Perches <joe@perches.com> | 2013-02-11 12:38:05 -0500 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-02-13 14:32:46 -0500 |
| commit | 535ec049e82e391dbe8be55ecd9f392acd71d0d7 (patch) | |
| tree | d66fcf764cd8ab2fc981f0d96c9f80073bd09fc7 | |
| parent | d899eddde548b9a6d3a59d0600feaab377efcd3f (diff) | |
[media] staging: media: Remove unnecessary OOM messages
alloc failures already get standardized OOM
messages and a dump_stack.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
| -rw-r--r-- | drivers/staging/media/as102/as102_usb_drv.c | 4 | ||||
| -rw-r--r-- | drivers/staging/media/go7007/go7007-fw.c | 24 | ||||
| -rw-r--r-- | drivers/staging/media/go7007/s2250-loader.c | 5 | ||||
| -rw-r--r-- | drivers/staging/media/lirc/lirc_imon.c | 3 | ||||
| -rw-r--r-- | drivers/staging/media/lirc/lirc_sasem.c | 6 |
5 files changed, 10 insertions, 32 deletions
diff --git a/drivers/staging/media/as102/as102_usb_drv.c b/drivers/staging/media/as102/as102_usb_drv.c index aaf1bc2ad1b2..9f275f020150 100644 --- a/drivers/staging/media/as102/as102_usb_drv.c +++ b/drivers/staging/media/as102/as102_usb_drv.c | |||
| @@ -374,10 +374,8 @@ static int as102_usb_probe(struct usb_interface *intf, | |||
| 374 | } | 374 | } |
| 375 | 375 | ||
| 376 | as102_dev = kzalloc(sizeof(struct as102_dev_t), GFP_KERNEL); | 376 | as102_dev = kzalloc(sizeof(struct as102_dev_t), GFP_KERNEL); |
| 377 | if (as102_dev == NULL) { | 377 | if (as102_dev == NULL) |
| 378 | dev_err(&intf->dev, "%s: kzalloc failed\n", __func__); | ||
| 379 | return -ENOMEM; | 378 | return -ENOMEM; |
| 380 | } | ||
| 381 | 379 | ||
| 382 | /* Assign the user-friendly device name */ | 380 | /* Assign the user-friendly device name */ |
| 383 | for (i = 0; i < ARRAY_SIZE(as102_usb_id_table); i++) { | 381 | for (i = 0; i < ARRAY_SIZE(as102_usb_id_table); i++) { |
diff --git a/drivers/staging/media/go7007/go7007-fw.c b/drivers/staging/media/go7007/go7007-fw.c index f99c05b454b0..a5ede1c109d0 100644 --- a/drivers/staging/media/go7007/go7007-fw.c +++ b/drivers/staging/media/go7007/go7007-fw.c | |||
| @@ -381,11 +381,8 @@ static int gen_mjpeghdr_to_package(struct go7007 *go, __le16 *code, int space) | |||
| 381 | int size = 0, i, off = 0, chunk; | 381 | int size = 0, i, off = 0, chunk; |
| 382 | 382 | ||
| 383 | buf = kzalloc(4096, GFP_KERNEL); | 383 | buf = kzalloc(4096, GFP_KERNEL); |
| 384 | if (buf == NULL) { | 384 | if (buf == NULL) |
| 385 | dev_err(go->dev, | ||
| 386 | "unable to allocate 4096 bytes for firmware construction\n"); | ||
| 387 | return -1; | 385 | return -1; |
| 388 | } | ||
| 389 | 386 | ||
| 390 | for (i = 1; i < 32; ++i) { | 387 | for (i = 1; i < 32; ++i) { |
| 391 | mjpeg_frame_header(go, buf + size, i); | 388 | mjpeg_frame_header(go, buf + size, i); |
| @@ -651,11 +648,9 @@ static int gen_mpeg1hdr_to_package(struct go7007 *go, | |||
| 651 | int i, off = 0, chunk; | 648 | int i, off = 0, chunk; |
| 652 | 649 | ||
| 653 | buf = kzalloc(5120, GFP_KERNEL); | 650 | buf = kzalloc(5120, GFP_KERNEL); |
| 654 | if (buf == NULL) { | 651 | if (buf == NULL) |
| 655 | dev_err(go->dev, | ||
| 656 | "unable to allocate 5120 bytes for firmware construction\n"); | ||
| 657 | return -1; | 652 | return -1; |
| 658 | } | 653 | |
| 659 | framelen[0] = mpeg1_frame_header(go, buf, 0, 1, PFRAME); | 654 | framelen[0] = mpeg1_frame_header(go, buf, 0, 1, PFRAME); |
| 660 | if (go->interlace_coding) | 655 | if (go->interlace_coding) |
| 661 | framelen[0] += mpeg1_frame_header(go, buf + framelen[0] / 8, | 656 | framelen[0] += mpeg1_frame_header(go, buf + framelen[0] / 8, |
| @@ -838,11 +833,9 @@ static int gen_mpeg4hdr_to_package(struct go7007 *go, | |||
| 838 | int i, off = 0, chunk; | 833 | int i, off = 0, chunk; |
| 839 | 834 | ||
| 840 | buf = kzalloc(5120, GFP_KERNEL); | 835 | buf = kzalloc(5120, GFP_KERNEL); |
| 841 | if (buf == NULL) { | 836 | if (buf == NULL) |
| 842 | dev_err(go->dev, | ||
| 843 | "unable to allocate 5120 bytes for firmware construction\n"); | ||
| 844 | return -1; | 837 | return -1; |
| 845 | } | 838 | |
| 846 | framelen[0] = mpeg4_frame_header(go, buf, 0, PFRAME); | 839 | framelen[0] = mpeg4_frame_header(go, buf, 0, PFRAME); |
| 847 | i = 368; | 840 | i = 368; |
| 848 | framelen[1] = mpeg4_frame_header(go, buf + i, 0, BFRAME_PRE); | 841 | framelen[1] = mpeg4_frame_header(go, buf + i, 0, BFRAME_PRE); |
| @@ -1582,12 +1575,9 @@ int go7007_construct_fw_image(struct go7007 *go, u8 **fw, int *fwlen) | |||
| 1582 | return -1; | 1575 | return -1; |
| 1583 | } | 1576 | } |
| 1584 | code = kzalloc(codespace * 2, GFP_KERNEL); | 1577 | code = kzalloc(codespace * 2, GFP_KERNEL); |
| 1585 | if (code == NULL) { | 1578 | if (code == NULL) |
| 1586 | dev_err(go->dev, | ||
| 1587 | "unable to allocate %d bytes for firmware construction\n", | ||
| 1588 | codespace * 2); | ||
| 1589 | goto fw_failed; | 1579 | goto fw_failed; |
| 1590 | } | 1580 | |
| 1591 | src = (__le16 *)fw_entry->data; | 1581 | src = (__le16 *)fw_entry->data; |
| 1592 | srclen = fw_entry->size / 2; | 1582 | srclen = fw_entry->size / 2; |
| 1593 | while (srclen >= 2) { | 1583 | while (srclen >= 2) { |
diff --git a/drivers/staging/media/go7007/s2250-loader.c b/drivers/staging/media/go7007/s2250-loader.c index f57eb3beb341..72e5175fe7e3 100644 --- a/drivers/staging/media/go7007/s2250-loader.c +++ b/drivers/staging/media/go7007/s2250-loader.c | |||
| @@ -81,10 +81,9 @@ static int s2250loader_probe(struct usb_interface *interface, | |||
| 81 | 81 | ||
| 82 | /* Allocate dev data structure */ | 82 | /* Allocate dev data structure */ |
| 83 | s = kmalloc(sizeof(device_extension_t), GFP_KERNEL); | 83 | s = kmalloc(sizeof(device_extension_t), GFP_KERNEL); |
| 84 | if (s == NULL) { | 84 | if (s == NULL) |
| 85 | dev_err(&interface->dev, "Out of memory\n"); | ||
| 86 | goto failed; | 85 | goto failed; |
| 87 | } | 86 | |
| 88 | s2250_dev_table[minor] = s; | 87 | s2250_dev_table[minor] = s; |
| 89 | 88 | ||
| 90 | dev_info(&interface->dev, | 89 | dev_info(&interface->dev, |
diff --git a/drivers/staging/media/lirc/lirc_imon.c b/drivers/staging/media/lirc/lirc_imon.c index 343c622f9387..0a2c45dd4475 100644 --- a/drivers/staging/media/lirc/lirc_imon.c +++ b/drivers/staging/media/lirc/lirc_imon.c | |||
| @@ -744,7 +744,6 @@ static int imon_probe(struct usb_interface *interface, | |||
| 744 | 744 | ||
| 745 | context = kzalloc(sizeof(struct imon_context), GFP_KERNEL); | 745 | context = kzalloc(sizeof(struct imon_context), GFP_KERNEL); |
| 746 | if (!context) { | 746 | if (!context) { |
| 747 | dev_err(dev, "%s: kzalloc failed for context\n", __func__); | ||
| 748 | alloc_status = 1; | 747 | alloc_status = 1; |
| 749 | goto alloc_status_switch; | 748 | goto alloc_status_switch; |
| 750 | } | 749 | } |
| @@ -826,13 +825,11 @@ static int imon_probe(struct usb_interface *interface, | |||
| 826 | 825 | ||
| 827 | driver = kzalloc(sizeof(struct lirc_driver), GFP_KERNEL); | 826 | driver = kzalloc(sizeof(struct lirc_driver), GFP_KERNEL); |
| 828 | if (!driver) { | 827 | if (!driver) { |
| 829 | dev_err(dev, "%s: kzalloc failed for lirc_driver\n", __func__); | ||
| 830 | alloc_status = 2; | 828 | alloc_status = 2; |
| 831 | goto alloc_status_switch; | 829 | goto alloc_status_switch; |
| 832 | } | 830 | } |
| 833 | rbuf = kmalloc(sizeof(struct lirc_buffer), GFP_KERNEL); | 831 | rbuf = kmalloc(sizeof(struct lirc_buffer), GFP_KERNEL); |
| 834 | if (!rbuf) { | 832 | if (!rbuf) { |
| 835 | dev_err(dev, "%s: kmalloc failed for lirc_buffer\n", __func__); | ||
| 836 | alloc_status = 3; | 833 | alloc_status = 3; |
| 837 | goto alloc_status_switch; | 834 | goto alloc_status_switch; |
| 838 | } | 835 | } |
diff --git a/drivers/staging/media/lirc/lirc_sasem.c b/drivers/staging/media/lirc/lirc_sasem.c index b3fe21e7a90d..68acca74ddb1 100644 --- a/drivers/staging/media/lirc/lirc_sasem.c +++ b/drivers/staging/media/lirc/lirc_sasem.c | |||
| @@ -759,22 +759,16 @@ static int sasem_probe(struct usb_interface *interface, | |||
| 759 | 759 | ||
| 760 | context = kzalloc(sizeof(struct sasem_context), GFP_KERNEL); | 760 | context = kzalloc(sizeof(struct sasem_context), GFP_KERNEL); |
| 761 | if (!context) { | 761 | if (!context) { |
| 762 | dev_err(&interface->dev, | ||
| 763 | "%s: kzalloc failed for context\n", __func__); | ||
| 764 | alloc_status = 1; | 762 | alloc_status = 1; |
| 765 | goto alloc_status_switch; | 763 | goto alloc_status_switch; |
| 766 | } | 764 | } |
| 767 | driver = kzalloc(sizeof(struct lirc_driver), GFP_KERNEL); | 765 | driver = kzalloc(sizeof(struct lirc_driver), GFP_KERNEL); |
| 768 | if (!driver) { | 766 | if (!driver) { |
| 769 | dev_err(&interface->dev, | ||
| 770 | "%s: kzalloc failed for lirc_driver\n", __func__); | ||
| 771 | alloc_status = 2; | 767 | alloc_status = 2; |
| 772 | goto alloc_status_switch; | 768 | goto alloc_status_switch; |
| 773 | } | 769 | } |
| 774 | rbuf = kmalloc(sizeof(struct lirc_buffer), GFP_KERNEL); | 770 | rbuf = kmalloc(sizeof(struct lirc_buffer), GFP_KERNEL); |
| 775 | if (!rbuf) { | 771 | if (!rbuf) { |
| 776 | dev_err(&interface->dev, | ||
| 777 | "%s: kmalloc failed for lirc_buffer\n", __func__); | ||
| 778 | alloc_status = 3; | 772 | alloc_status = 3; |
| 779 | goto alloc_status_switch; | 773 | goto alloc_status_switch; |
| 780 | } | 774 | } |
