From patchwork Mon Mar 30 13:55:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 6121071 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2C939BF4A6 for ; Mon, 30 Mar 2015 13:58:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 10CBB2044B for ; Mon, 30 Mar 2015 13:58:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3121420444 for ; Mon, 30 Mar 2015 13:57:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753455AbbC3N5Q (ORCPT ); Mon, 30 Mar 2015 09:57:16 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:35991 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753450AbbC3N5M (ORCPT ); Mon, 30 Mar 2015 09:57:12 -0400 Received: by pdcp1 with SMTP id p1so84951601pdc.3 for ; Mon, 30 Mar 2015 06:57:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6dAuZ8YDqMLTGvgsmPkx3kPOtsf9VLF79Pb43vojuUo=; b=hOtAglD1YkCJgX5gj5cZX6LUUBjfF3gkKhvnurzF2QZWlT9reYeNPvGbuThIDIedFj fbE/XH2/ogkWo/ORkz3xah+lIr0jqeBMJWFbT2Gu1/zwLE+cuy7ASOOV4W1+y31pP/gC v11cLNWQvR2BUg2Xpr+l99ppEtOFplABKJ02vi+a6Onch/fprrqUL9xZ10/Vk6Lk4dxh q6+zTKKHZJK7Cf/cP/WQfm3KnhnAnbTrzUVGOZ4TrbM4P/2q5TpIg2a0snd1O3U9fSX2 k1vy1O0GMg+cskZovKhzFpgrGJqiybLE5s1H65jIu6StU8ihaAoB8KA4iddTkgpWqDdV 62Gw== X-Gm-Message-State: ALoCoQm9ZryGUhDCchxUKAlzo6M01AsJ46349db/cpxQSk6nRj25YLzEvf+6jabByqWyUUplkOoj X-Received: by 10.68.164.161 with SMTP id yr1mr60062506pbb.22.1427723831764; Mon, 30 Mar 2015 06:57:11 -0700 (PDT) Received: from host1.lsi.com ([192.19.239.250]) by mx.google.com with ESMTPSA id pb2sm10821201pdb.33.2015.03.30.06.57.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 30 Mar 2015 06:57:10 -0700 (PDT) From: Sreekanth Reddy X-Google-Original-From: Sreekanth Reddy To: jejb@kernel.org, hch@infradead.org Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, JBottomley@Parallels.com, Sathya.Prakash@avagotech.com, kashyap.desai@avagotech.com, linux-kernel@vger.kernel.org, thenzl@redhat.com, Sreekanth Reddy Subject: [PATCH 18/20] [SCSI] mpt3sas: Call dma_mapping_error() API after mapping an address with dma_map_single() API Date: Mon, 30 Mar 2015 19:25:21 +0530 Message-Id: <1427723723-12676-19-git-send-email-Sreekanth.Reddy@avagotech.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1427723723-12676-1-git-send-email-Sreekanth.Reddy@avagotech.com> References: <1427723723-12676-1-git-send-email-Sreekanth.Reddy@avagotech.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Added dma_mapping_error() API after mapping an address with dma_map_single() API. Otherwise when CONFIG_DMA_API_DEBUG is enabled in the kernel, then it complains about mpt3sas driver not calling dma_mapping_error after mapping an address with dma_map_single Signed-off-by: Sreekanth Reddy --- drivers/scsi/mpt3sas/mpt3sas_transport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c b/drivers/scsi/mpt3sas/mpt3sas_transport.c index 1695f0f..52bfc78 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_transport.c +++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c @@ -1960,7 +1960,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, } else { dma_addr_out = pci_map_single(ioc->pdev, bio_data(req->bio), blk_rq_bytes(req), PCI_DMA_BIDIRECTIONAL); - if (!dma_addr_out) { + if (pci_dma_mapping_error(ioc->pdev, dma_addr_out)) { pr_info(MPT3SAS_FMT "%s(): DMA Addr out = NULL\n", ioc->name, __func__); rc = -ENOMEM; @@ -1982,7 +1982,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, } else { dma_addr_in = pci_map_single(ioc->pdev, bio_data(rsp->bio), blk_rq_bytes(rsp), PCI_DMA_BIDIRECTIONAL); - if (!dma_addr_in) { + if (pci_dma_mapping_error(ioc->pdev, dma_addr_in)) { pr_info(MPT3SAS_FMT "%s(): DMA Addr in = NULL\n", ioc->name, __func__); rc = -ENOMEM;