diff options
author | Wolfram Sang <wsa-dev@sang-engineering.com> | 2016-08-25 13:39:31 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-30 13:17:39 -0400 |
commit | e5cdac9242f58ca0122822e8fd7cab03c7faeb07 (patch) | |
tree | ba2b12fec3a7e9cd99b6eb7cb020f75cb2998e4f /drivers/usb | |
parent | c34515f87501fc1cb49ec1a104b9a69e4a263e80 (diff) |
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/storage/alauda.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/usb/storage/alauda.c b/drivers/usb/storage/alauda.c index 1d8b03c81030..878b4b8761f5 100644 --- a/drivers/usb/storage/alauda.c +++ b/drivers/usb/storage/alauda.c | |||
@@ -939,10 +939,8 @@ static int alauda_read_data(struct us_data *us, unsigned long address, | |||
939 | 939 | ||
940 | len = min(sectors, blocksize) * (pagesize + 64); | 940 | len = min(sectors, blocksize) * (pagesize + 64); |
941 | buffer = kmalloc(len, GFP_NOIO); | 941 | buffer = kmalloc(len, GFP_NOIO); |
942 | if (buffer == NULL) { | 942 | if (!buffer) |
943 | printk(KERN_WARNING "alauda_read_data: Out of memory\n"); | ||
944 | return USB_STOR_TRANSPORT_ERROR; | 943 | return USB_STOR_TRANSPORT_ERROR; |
945 | } | ||
946 | 944 | ||
947 | /* Figure out the initial LBA and page */ | 945 | /* Figure out the initial LBA and page */ |
948 | lba = address >> blockshift; | 946 | lba = address >> blockshift; |
@@ -1033,18 +1031,15 @@ static int alauda_write_data(struct us_data *us, unsigned long address, | |||
1033 | 1031 | ||
1034 | len = min(sectors, blocksize) * pagesize; | 1032 | len = min(sectors, blocksize) * pagesize; |
1035 | buffer = kmalloc(len, GFP_NOIO); | 1033 | buffer = kmalloc(len, GFP_NOIO); |
1036 | if (buffer == NULL) { | 1034 | if (!buffer) |
1037 | printk(KERN_WARNING "alauda_write_data: Out of memory\n"); | ||
1038 | return USB_STOR_TRANSPORT_ERROR; | 1035 | return USB_STOR_TRANSPORT_ERROR; |
1039 | } | ||
1040 | 1036 | ||
1041 | /* | 1037 | /* |
1042 | * We also need a temporary block buffer, where we read in the old data, | 1038 | * We also need a temporary block buffer, where we read in the old data, |
1043 | * overwrite parts with the new data, and manipulate the redundancy data | 1039 | * overwrite parts with the new data, and manipulate the redundancy data |
1044 | */ | 1040 | */ |
1045 | blockbuffer = kmalloc((pagesize + 64) * blocksize, GFP_NOIO); | 1041 | blockbuffer = kmalloc((pagesize + 64) * blocksize, GFP_NOIO); |
1046 | if (blockbuffer == NULL) { | 1042 | if (!blockbuffer) { |
1047 | printk(KERN_WARNING "alauda_write_data: Out of memory\n"); | ||
1048 | kfree(buffer); | 1043 | kfree(buffer); |
1049 | return USB_STOR_TRANSPORT_ERROR; | 1044 | return USB_STOR_TRANSPORT_ERROR; |
1050 | } | 1045 | } |