Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp4593683pja; Thu, 21 Nov 2019 22:29:51 -0800 (PST) X-Google-Smtp-Source: APXvYqwmdAf+tBf91BnWu6PwdPgtIcbR3tQEKHy6k54VUMeA+KD+i0sMS0ekrjEklbl+2NynI8Sl X-Received: by 2002:a17:906:2508:: with SMTP id i8mr7096297ejb.323.1574404191136; Thu, 21 Nov 2019 22:29:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574404191; cv=none; d=google.com; s=arc-20160816; b=uCB197uXFCCzXv54cIclYXtgDWISKYFk2LEqW4soBz4DBdc7zUS1AO3319zYQBmjaY aCbJz7nSNL0b6dP7nXZ2cdD+q5WvVHkYBTKWXqFobxfQ62j7KzILgOnZ1HHX3jtgi5/O 1kaVdY7zaw+9nuxI9KgEclG1vtAZqpT9oSQ3d6/cVvdYokoVP3tPHEyO+5opQX6NeEkK 7jzY805Kc73S2dqJYaywOXisB2/TJlWrY0NHDKDchMbW0bH/gQfrnHCSJ/XHEWG6gKIF ai2GqDE331LPUIZKvfQWilvaInwwlrjfImPcroCmEefL9l6b+RGwcE2oGgW6p5YpH5eS 6NpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sgoSYD7lz7Q9nV2ap7mLntvhg7XhGCUgZ90+6bTySK0=; b=FPI4htFNvJ67FKbLis2FmycLcvBVh/6sVJRpalVerhJXQ1h1iLZiVxBgv0ENMScYlG 8PWUdWsQ3ACL5DxmfAZHmFNAjlAxitkQV3cvd70hq1b8t9TztVxXyxbl8+JYtQM+HS9x oENxRdC2ms5ihPB4m6HQzuyNXm6BK2HgQWuPe9EbWFhdYSBkrUj41jgoBvgNhsZeluli x+PzVmztZOFdWs7gsfYUK6OompsAmRp1H0i77rIpNd917IMDSXZJSGtxy9PfG9C7C5Ff EG3nIbKdAF7AS5zF3AT7sWtl1yiuYKmj8SnbNFF7qZmzIYfQZeaZ+Imi4aAd9K/YSG5u ctwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="uoBDT4A/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n4si4054563edy.53.2019.11.21.22.29.27; Thu, 21 Nov 2019 22:29:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="uoBDT4A/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728039AbfKVFvL (ORCPT + 99 others); Fri, 22 Nov 2019 00:51:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:56088 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727999AbfKVFvI (ORCPT ); Fri, 22 Nov 2019 00:51:08 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CEE252070E; Fri, 22 Nov 2019 05:51:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574401867; bh=7jsGRtCxAHLdVRqPPVCUZabSwN7tXyWjLgh3iSCiD4Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uoBDT4A/Uj+O74lZxBRjPdIperN79xI9Gg1nbzLpJX4G2QKaiJezmsFY+FxtEtsty 3PMS9Y3m5amBUb40NGplRaOC/wvZl6K+EGwB1EvofPa1+WruRijFuNLm4uCDoGdxPW Je8rIET/CEbmZ3fbpibM3YcO2v/VsLd//fQLIwpw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dan Carpenter , Jason Gunthorpe , Sasha Levin , linux-rdma@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 103/219] IB/qib: Fix an error code in qib_sdma_verbs_send() Date: Fri, 22 Nov 2019 00:47:15 -0500 Message-Id: <20191122054911.1750-96-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191122054911.1750-1-sashal@kernel.org> References: <20191122054911.1750-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit 5050ae5fa3d54c8e83e1e447cc7e3591110a7f57 ] We accidentally return success on this error path. Fixes: f931551bafe1 ("IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters") Signed-off-by: Dan Carpenter Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/qib/qib_sdma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/qib/qib_sdma.c b/drivers/infiniband/hw/qib/qib_sdma.c index d0723d4aef5c9..7424e88b0d918 100644 --- a/drivers/infiniband/hw/qib/qib_sdma.c +++ b/drivers/infiniband/hw/qib/qib_sdma.c @@ -576,8 +576,10 @@ int qib_sdma_verbs_send(struct qib_pportdata *ppd, dw = (len + 3) >> 2; addr = dma_map_single(&ppd->dd->pcidev->dev, sge->vaddr, dw << 2, DMA_TO_DEVICE); - if (dma_mapping_error(&ppd->dd->pcidev->dev, addr)) + if (dma_mapping_error(&ppd->dd->pcidev->dev, addr)) { + ret = -ENOMEM; goto unmap; + } sdmadesc[0] = 0; make_sdma_desc(ppd, sdmadesc, (u64) addr, dw, dwoffset); /* SDmaUseLargeBuf has to be set in every descriptor */ -- 2.20.1