From: Abdelrahman Fekry <abdelrahmanfekry375@gmail.com>
To: hansg@kernel.org, mchehab@kernel.org,
sakari.ailus@linux.intel.com, andy@kernel.org,
gregkh@linuxfoundation.org
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-staging@lists.linux.dev,
linux-kernel-mentees@lists.linux.dev, skhan@linuxfoundation.org,
dan.carpenter@linaro.org,
Abdelrahman Fekry <abdelrahmanfekry375@gmail.com>
Subject: [PATCH 1/3] staging: media: atomisp: return early on hmm_bo_device_init() failure
Date: Sat, 12 Jul 2025 22:13:23 +0300 [thread overview]
Message-ID: <20250712191325.132666-2-abdelrahmanfekry375@gmail.com> (raw)
In-Reply-To: <20250712191325.132666-1-abdelrahmanfekry375@gmail.com>
hmm_init() would continue execution even if hmm_bo_device_init() failed,
potentially leading to bad behaviour when calling hmm_alloc().
- returns the error immediately if hmm_bo_device_init() fails.
Signed-off-by: Abdelrahman Fekry <abdelrahmanfekry375@gmail.com>
---
drivers/staging/media/atomisp/pci/hmm/hmm.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/media/atomisp/pci/hmm/hmm.c b/drivers/staging/media/atomisp/pci/hmm/hmm.c
index f998b57f90c4..97c7ce970aef 100644
--- a/drivers/staging/media/atomisp/pci/hmm/hmm.c
+++ b/drivers/staging/media/atomisp/pci/hmm/hmm.c
@@ -34,8 +34,10 @@ int hmm_init(void)
ret = hmm_bo_device_init(&bo_device, &sh_mmu_mrfld,
ISP_VM_START, ISP_VM_SIZE);
- if (ret)
+ if (ret) {
dev_err(atomisp_dev, "hmm_bo_device_init failed.\n");
+ return ret;
+ }
hmm_initialized = true;
@@ -48,7 +50,7 @@ int hmm_init(void)
*/
dummy_ptr = hmm_alloc(1);
- return ret;
+ return 0;
}
void hmm_cleanup(void)
--
2.25.1
next prev parent reply other threads:[~2025-07-12 19:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-12 19:13 [PATCH 0/3] staging: media: atomisp: More Cleanup on driver AtomIsp Abdelrahman Fekry
2025-07-12 19:13 ` Abdelrahman Fekry [this message]
2025-07-12 19:13 ` [PATCH 2/3] staging: media: atomisp: unify HMM initialization tracking Abdelrahman Fekry
2025-07-12 19:13 ` [PATCH 3/3] staging: media: atomisp: move hmm_get_mmu_base_addr() Abdelrahman Fekry
2025-07-16 18:21 ` [PATCH 0/3] staging: media: atomisp: More Cleanup on driver AtomIsp Dan Carpenter
2025-07-17 1:35 ` Abdelrahman Fekry
2025-07-31 3:24 ` Abdelrahman Fekry
2025-07-31 4:35 ` Greg KH
2025-07-31 5:59 ` Abdelrahman Fekry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250712191325.132666-2-abdelrahmanfekry375@gmail.com \
--to=abdelrahmanfekry375@gmail.com \
--cc=andy@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=hansg@kernel.org \
--cc=linux-kernel-mentees@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.