Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: storage: alauda: don't print on ENOMEM

All kmalloc-based functions print enough information on failures.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Wolfram Sang and committed by
Greg Kroah-Hartman
e5cdac92 c34515f8

+3 -8
+3 -8
drivers/usb/storage/alauda.c
··· 939 939 940 940 len = min(sectors, blocksize) * (pagesize + 64); 941 941 buffer = kmalloc(len, GFP_NOIO); 942 - if (buffer == NULL) { 943 - printk(KERN_WARNING "alauda_read_data: Out of memory\n"); 942 + if (!buffer) 944 943 return USB_STOR_TRANSPORT_ERROR; 945 - } 946 944 947 945 /* Figure out the initial LBA and page */ 948 946 lba = address >> blockshift; ··· 1031 1033 1032 1034 len = min(sectors, blocksize) * pagesize; 1033 1035 buffer = kmalloc(len, GFP_NOIO); 1034 - if (buffer == NULL) { 1035 - printk(KERN_WARNING "alauda_write_data: Out of memory\n"); 1036 + if (!buffer) 1036 1037 return USB_STOR_TRANSPORT_ERROR; 1037 - } 1038 1038 1039 1039 /* 1040 1040 * We also need a temporary block buffer, where we read in the old data, 1041 1041 * overwrite parts with the new data, and manipulate the redundancy data 1042 1042 */ 1043 1043 blockbuffer = kmalloc((pagesize + 64) * blocksize, GFP_NOIO); 1044 - if (blockbuffer == NULL) { 1045 - printk(KERN_WARNING "alauda_write_data: Out of memory\n"); 1044 + if (!blockbuffer) { 1046 1045 kfree(buffer); 1047 1046 return USB_STOR_TRANSPORT_ERROR; 1048 1047 }