mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: vme_user: fix crcsr_bus assignment on allocation failure
@ 2026-10-21  3:02 LiuJunyuan
  2026-10-21  5:57 ` Dan Carpenter
  2026-10-21  6:17 ` Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: LiuJunyuan @ 2026-10-21  3:02 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, LiuJunyuan

Assign bridge->crcsr_bus only after bridge->crcsr_kernel has been
successfully allocated.

Signed-off-by: LiuJunyuan <2058432396@qq.com>
---
 drivers/staging/vme_user/vme_fake.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vme_user/vme_fake.c b/drivers/staging/vme_user/vme_fake.c
index 434cf760ade6..5a4e61d20479 100644
--- a/drivers/staging/vme_user/vme_fake.c
+++ b/drivers/staging/vme_user/vme_fake.c
@@ -1029,9 +1029,9 @@ static int fake_crcsr_init(struct vme_bridge *fake_bridge)
 
 	/* Allocate mem for CR/CSR image */
 	bridge->crcsr_kernel = kzalloc(VME_CRCSR_BUF_SIZE, GFP_KERNEL);
-	bridge->crcsr_bus = fake_ptr_to_pci(bridge->crcsr_kernel);
 	if (!bridge->crcsr_kernel)
 		return -ENOMEM;
+	bridge->crcsr_bus = fake_ptr_to_pci(bridge->crcsr_kernel);
 
 	vstat = fake_slot_get(fake_bridge);
 
-- 
2.43.0


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

end of thread, other threads:[~2026-10-21  6:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-21  3:02 [PATCH] staging: vme_user: fix crcsr_bus assignment on allocation failure LiuJunyuan
2026-10-21  5:57 ` Dan Carpenter
2026-10-21  6:17 ` Greg KH

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

all inboxes | Powered by JetHome®