Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1297433 > unrolled thread

[PATCH char-misc-next] misc: mic: return proper error code

Started bySudip Mukherjee <sudipm.mukherjee@gmail.com>
First post2015-12-23 13:50 +0100
Last post2015-12-23 13:50 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH char-misc-next] misc: mic: return proper error code Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-12-23 13:50 +0100

#1297433 — [PATCH char-misc-next] misc: mic: return proper error code

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2015-12-23 13:50 +0100
Subject[PATCH char-misc-next] misc: mic: return proper error code
Message-ID<qIR1E-1bM-5@gated-at.bofh.it>
On error we are supposed to return negative error code but here we
missed giving the nagative sign. It was never a problem because the
pointer returned from scif_add_mmu_notifier() was never tested. But even
though we should be returning negative error.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/misc/mic/scif/scif_dma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/mic/scif/scif_dma.c b/drivers/misc/mic/scif/scif_dma.c
index 95a13c6..f998daa 100644
--- a/drivers/misc/mic/scif/scif_dma.c
+++ b/drivers/misc/mic/scif/scif_dma.c
@@ -293,13 +293,13 @@ scif_add_mmu_notifier(struct mm_struct *mm, struct scif_endpt *ep)
 		 = kzalloc(sizeof(*mmn), GFP_KERNEL);
 
 	if (!mmn)
-		return ERR_PTR(ENOMEM);
+		return ERR_PTR(-ENOMEM);
 
 	scif_init_mmu_notifier(mmn, current->mm, ep);
 	if (mmu_notifier_register(&mmn->ep_mmu_notifier,
 				  current->mm)) {
 		kfree(mmn);
-		return ERR_PTR(EBUSY);
+		return ERR_PTR(-EBUSY);
 	}
 	list_add(&mmn->list, &ep->rma_info.mmn_list);
 	return mmn;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web