ipr: Fix regression when loading firmware
authorGabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Thu, 25 Feb 2016 16:54:20 +0000 (13:54 -0300)
committerDanny Wood <danwood76@gmail.com>
Tue, 29 Jan 2019 13:12:40 +0000 (13:12 +0000)
commit4eaf171ae69707f44e9325b49a2274beada07da1
tree8295f3acfbd28c7cee8227376e7152f6a51da178
parentc962e4fbd9f2531707482a6640985c1a9d605fb3
ipr: Fix regression when loading firmware

commit 21b81716c6bff24cda52dc75588455f879ddbfe9 upstream.

Commit d63c7dd5bcb9 ("ipr: Fix out-of-bounds null overwrite") removed
the end of line handling when storing the update_fw sysfs attribute.
This changed the userpace API because it started refusing writes
terminated by a line feed, which broke the update tools we already have.

This patch re-adds that handling, so both a write terminated by a line
feed or not can make it through with the update.

Fixes: d63c7dd5bcb9 ("ipr: Fix out-of-bounds null overwrite")
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Cc: Insu Yun <wuninsu@gmail.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/scsi/ipr.c