mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH char-misc-next] misc: mic: return proper error code
@ 2015-12-23 12:45 Sudip Mukherjee
  0 siblings, 0 replies; only message in thread
From: Sudip Mukherjee @ 2015-12-23 12:45 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Sudeep Dutt; +Cc: linux-kernel, Sudip Mukherjee

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-23 12:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-23 12:45 [PATCH char-misc-next] misc: mic: return proper error code Sudip Mukherjee

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®