Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5cdac92 authored by Wolfram Sang's avatar Wolfram Sang Committed by Greg Kroah-Hartman
Browse files

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



All kmalloc-based functions print enough information on failures.

Signed-off-by: default avatarWolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c34515f8
Loading
Loading
Loading
Loading
+3 −8
Original line number Original line Diff line number Diff line
@@ -939,10 +939,8 @@ static int alauda_read_data(struct us_data *us, unsigned long address,


	len = min(sectors, blocksize) * (pagesize + 64);
	len = min(sectors, blocksize) * (pagesize + 64);
	buffer = kmalloc(len, GFP_NOIO);
	buffer = kmalloc(len, GFP_NOIO);
	if (buffer == NULL) {
	if (!buffer)
		printk(KERN_WARNING "alauda_read_data: Out of memory\n");
		return USB_STOR_TRANSPORT_ERROR;
		return USB_STOR_TRANSPORT_ERROR;
	}


	/* Figure out the initial LBA and page */
	/* Figure out the initial LBA and page */
	lba = address >> blockshift;
	lba = address >> blockshift;
@@ -1033,18 +1031,15 @@ static int alauda_write_data(struct us_data *us, unsigned long address,


	len = min(sectors, blocksize) * pagesize;
	len = min(sectors, blocksize) * pagesize;
	buffer = kmalloc(len, GFP_NOIO);
	buffer = kmalloc(len, GFP_NOIO);
	if (buffer == NULL) {
	if (!buffer)
		printk(KERN_WARNING "alauda_write_data: Out of memory\n");
		return USB_STOR_TRANSPORT_ERROR;
		return USB_STOR_TRANSPORT_ERROR;
	}


	/*
	/*
	 * We also need a temporary block buffer, where we read in the old data,
	 * We also need a temporary block buffer, where we read in the old data,
	 * overwrite parts with the new data, and manipulate the redundancy data
	 * overwrite parts with the new data, and manipulate the redundancy data
	 */
	 */
	blockbuffer = kmalloc((pagesize + 64) * blocksize, GFP_NOIO);
	blockbuffer = kmalloc((pagesize + 64) * blocksize, GFP_NOIO);
	if (blockbuffer == NULL) {
	if (!blockbuffer) {
		printk(KERN_WARNING "alauda_write_data: Out of memory\n");
		kfree(buffer);
		kfree(buffer);
		return USB_STOR_TRANSPORT_ERROR;
		return USB_STOR_TRANSPORT_ERROR;
	}
	}