]> www.infradead.org Git - users/dwmw2/linux.git/commit
remoteproc: Fix count check in rproc_coredump_write()
authorAlistair Delva <adelva@google.com>
Wed, 19 Jan 2022 23:21:39 +0000 (23:21 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 11:57:18 +0000 (13:57 +0200)
commit11572dad9fbadbd9269a2550f7e236b5b8c2d80c
tree52eeb4db30c01eaebefccd7142f6f84938a41da1
parent015164bba90bc1b2a6f7bdc5b06ffea7323a9062
remoteproc: Fix count check in rproc_coredump_write()

commit f89672cc3681952f2d06314981a6b45f8b0045d1 upstream.

Check count for 0, to avoid a potential underflow. Make the check the
same as the one in rproc_recovery_write().

Fixes: 3afdc59e4390 ("remoteproc: Add coredump debugfs entry")
Signed-off-by: Alistair Delva <adelva@google.com>
Cc: Rishabh Bhatnagar <rishabhb@codeaurora.org>
Cc: stable@vger.kernel.org
Cc: Ohad Ben-Cohen <ohad@wizery.com>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Sibi Sankar <sibis@codeaurora.org>
Cc: linux-remoteproc@vger.kernel.org
Cc: kernel-team@android.com
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220119232139.1125908-1-adelva@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/remoteproc/remoteproc_debugfs.c