Skip to contentSkip to conversation

misc: mic: return proper error code

PATCH New Sudip Mukherjee 1 participant 1 message Dec 23, 2015 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 misc: mic: return proper error code

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.

---
 drivers/misc/mic/scif/scif_dma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/misc/mic/scif/scif_dma.c +2 -2
index 95a13c6..f998daa 100644
@@ -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;
Signature · 1 line
1.9.1