From: Vladimir Zapolskiy Date: Thu, 21 May 2015 21:21:16 +0000 (+0300) Subject: fs: sysfs: don't pass count == 0 to bin file readers X-Git-Tag: omap-for-v4.2/fixes-rc1^2~93^2~6 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eaa5cd926345f86e9df1eb6b0490da539f5ce7d0;p=pandora-kernel.git fs: sysfs: don't pass count == 0 to bin file readers If count == 0 bytes are requested by a reader, sysfs_kf_bin_read() deliberately returns 0 without passing a potentially harmful value to some externally defined underlying battr->read() function. However in case of (pos == size && count) the next clause always sets count to 0 and this value is handed over to battr->read(). The change intends to make obsolete (and remove later) a redundant sanity check in battr->read(), if it is present, or add more protection to struct bin_attribute users, who does not care about input arguments. Signed-off-by: Vladimir Zapolskiy Acked-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed