author | Daniele Alessandrelli <daniele.alessandrelli@intel.com> | |
Mon, 18 Jan 2021 16:59:04 +0000 (16:59 +0000) | ||
committer | Bjorn Andersson <bjorn.andersson@linaro.org> | |
Tue, 9 Feb 2021 22:42:55 +0000 (16:42 -0600) | ||
commit | 43d3f2c715cefcfb89b10675728e9bf0d8bb98e3 | |
tree | b399ca74436e6dd77e2400f0448a6383af7d16fa | tree | snapshot (tar.xz tar.gz zip) |
parent | ca23ecfdbd44bac02cb6964a3793c565a389af96 | commit | diff |
remoteproc: core: Fix rproc->firmware free in rproc_set_firmware()
rproc_alloc_firmware() (called by rproc_alloc()) can allocate
rproc->firmware using kstrdup_const() and therefore should be freed
using kfree_const(); however, rproc_set_firmware() frees it using the
simple kfree(). This causes a kernel oops if a constant string is passed
to rproc_alloc() and rproc_set_firmware() is subsequently called.
Fix the above issue by using kfree_const() to free rproc->firmware in
rproc_set_firmware().
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com>
Link: https://lore.kernel.org/r/20210118165904.719999-1-daniele.alessandrelli@linux.intel.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
rproc_alloc_firmware() (called by rproc_alloc()) can allocate
rproc->firmware using kstrdup_const() and therefore should be freed
using kfree_const(); however, rproc_set_firmware() frees it using the
simple kfree(). This causes a kernel oops if a constant string is passed
to rproc_alloc() and rproc_set_firmware() is subsequently called.
Fix the above issue by using kfree_const() to free rproc->firmware in
rproc_set_firmware().
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com>
Link: https://lore.kernel.org/r/20210118165904.719999-1-daniele.alessandrelli@linux.intel.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/remoteproc/remoteproc_core.c | diff | blob | history |