public inbox for linux-arm-msm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] soc: qcom: mdt_loader: Fix split-firmware condition
@ 2022-02-15  3:48 Bjorn Andersson
  2022-02-22  4:01 ` Vinod Koul
  2022-02-24 20:53 ` (subset) " Bjorn Andersson
  0 siblings, 2 replies; 3+ messages in thread
From: Bjorn Andersson @ 2022-02-15  3:48 UTC (permalink / raw)
  To: Bjorn Andersson, Dmitry Baryshkov; +Cc: linux-arm-msm, linux-kernel

The updated condition checking if a segment can be found in the loaded
firmware blob, or need to be loaded from a separate file, incorrectly
classifies segments that ends at the end of the loaded blob. The result
is that the mdt loader attempts to load the segment from a separate
file.

Correct the conditional to use the loaded segment instead.

Fixes: ea90330fa329 ("soc: qcom: mdt_loader: Extend check for split firmware")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
 drivers/soc/qcom/mdt_loader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/mdt_loader.c b/drivers/soc/qcom/mdt_loader.c
index f0b1d969567c..366db493579b 100644
--- a/drivers/soc/qcom/mdt_loader.c
+++ b/drivers/soc/qcom/mdt_loader.c
@@ -329,7 +329,7 @@ static int __qcom_mdt_load(struct device *dev, const struct firmware *fw,
 		ptr = mem_region + offset;
 
 		if (phdr->p_filesz && phdr->p_offset < fw->size &&
-		    phdr->p_offset + phdr->p_filesz < fw->size) {
+		    phdr->p_offset + phdr->p_filesz <= fw->size) {
 			/* Firmware is large enough to be non-split */
 			if (phdr->p_offset + phdr->p_filesz > fw->size) {
 				dev_err(dev, "file %s segment %d would be truncated\n",
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] soc: qcom: mdt_loader: Fix split-firmware condition
  2022-02-15  3:48 [PATCH] soc: qcom: mdt_loader: Fix split-firmware condition Bjorn Andersson
@ 2022-02-22  4:01 ` Vinod Koul
  2022-02-24 20:53 ` (subset) " Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2022-02-22  4:01 UTC (permalink / raw)
  To: Bjorn Andersson; +Cc: Dmitry Baryshkov, linux-arm-msm, linux-kernel

On 14-02-22, 19:48, Bjorn Andersson wrote:
> The updated condition checking if a segment can be found in the loaded
> firmware blob, or need to be loaded from a separate file, incorrectly
> classifies segments that ends at the end of the loaded blob. The result
> is that the mdt loader attempts to load the segment from a separate
> file.
> 
> Correct the conditional to use the loaded segment instead.
> 
> Fixes: ea90330fa329 ("soc: qcom: mdt_loader: Extend check for split firmware")
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Reviewed-by: Vinod Koul <vkoul@kernel.org>

-- 
~Vinod

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: (subset) [PATCH] soc: qcom: mdt_loader: Fix split-firmware condition
  2022-02-15  3:48 [PATCH] soc: qcom: mdt_loader: Fix split-firmware condition Bjorn Andersson
  2022-02-22  4:01 ` Vinod Koul
@ 2022-02-24 20:53 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2022-02-24 20:53 UTC (permalink / raw)
  To: Dmitry Baryshkov, Bjorn Andersson; +Cc: linux-kernel, linux-arm-msm

On Mon, 14 Feb 2022 19:48:19 -0800, Bjorn Andersson wrote:
> The updated condition checking if a segment can be found in the loaded
> firmware blob, or need to be loaded from a separate file, incorrectly
> classifies segments that ends at the end of the loaded blob. The result
> is that the mdt loader attempts to load the segment from a separate
> file.
> 
> Correct the conditional to use the loaded segment instead.
> 
> [...]

Applied, thanks!

[1/1] soc: qcom: mdt_loader: Fix split-firmware condition
      commit: a1b019872693c74d919db4e267f451fc7af9a21c

Best regards,
-- 
Bjorn Andersson <bjorn.andersson@linaro.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-24 20:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-15  3:48 [PATCH] soc: qcom: mdt_loader: Fix split-firmware condition Bjorn Andersson
2022-02-22  4:01 ` Vinod Koul
2022-02-24 20:53 ` (subset) " Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox