Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9179906pxu; Mon, 28 Dec 2020 08:33:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJzSVzcVBkrWLoCWVDCZhYmqRxS5Oqi7lwid2iyX9ordKtVcpNssQ/1KDOWtTo3wAVy0J86R X-Received: by 2002:a17:906:e247:: with SMTP id gq7mr43427631ejb.27.1609173234611; Mon, 28 Dec 2020 08:33:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609173234; cv=none; d=google.com; s=arc-20160816; b=tGmHQlBNb3e/sDz9pCpGtWfc/Z3w1PpFF9dRztORyexobfRmKQyNQw0Yx1N1D9IclQ s0fEWD4ymtTFD7DRsEpuQpWVN0QPLZmEvIiNBjMQKc+eudH1uhOQxwRbjsyQSFXaQkR+ UMhrAjx5kHa+Vy8/as9RxvIs//jNFzKNjxcgv7R9BSYi81zKBwdxGmOCveMw523ovxgm L7SKdlNN87ZIo704YYIh55zA0Oiyu1/fk1l++6laW12UT2MaaRzZsmnmB9WmD8BL59cl wEqE0JELo7NOD/VmJp3yyLxW7taB23agZlKitBKgIhRHbEgHfk2uvdDXg42CSKSLCsxW LKrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9WdwUzuWhdqVGF1ir25JHPMfZwDqcAVEOApO36McnU0=; b=nBSnE5avZrshNRLgCDkAKd2k7Vfr6xY9c15zwSvU224/Q0eLufY0V2vxom65KF1L8R dKBW702FfjHIqeRxmSON+IIKaLN/Vn0dkvUt2qA/Nc99d//hPNh54vcpbv6wsOFIL/dC x7/3Z1ZXQp0CtqBTgwJnwe37rNgnLUw/G2xhap1yBl/P5LEY9gpFY17UHbR511TW5Kg8 Y4+o8Pu3N2Zo62q1YrK8PRNGY5/n7aboEsCMDM2jhHa910DC9SMNiLvy/2MSFgoddlxx pg3cAuuCv+SKIyrevqDekL8y43PkoqwxlFB5oBwtXXHVahE2p9InVQHDNlEYL41TaNTb 3d+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GJwjK+Ol; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ga12si18227000ejb.522.2020.12.28.08.33.31; Mon, 28 Dec 2020 08:33:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GJwjK+Ol; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2633685AbgL1Qah (ORCPT + 99 others); Mon, 28 Dec 2020 11:30:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:34254 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729637AbgL1NGc (ORCPT ); Mon, 28 Dec 2020 08:06:32 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D3228207C9; Mon, 28 Dec 2020 13:05:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160751; bh=UAFTBRjOWayQArKHk2ibWenA7R1IHmPQWIiHUJtUm0M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GJwjK+Olzo8cvEng+RE3MSYMwq3LJROE0oU9MlkzSTpEiLiBqU8+BAdtrpBe/amnk sk+RjojDW25m61kqHPapH7C1nQZSELZClxIal3nhWQOwmWZvNh341fcMQqfygXcrBY wkoBOC/AKdFcvH9qUGY+zufkaAT0gS1xqogHK3vw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Vincent=20Stehl=C3=A9?= , Geert Uytterhoeven , Michael Ellerman , Sasha Levin Subject: [PATCH 4.9 118/175] powerpc/ps3: use dma_mapping_error() Date: Mon, 28 Dec 2020 13:49:31 +0100 Message-Id: <20201228124858.973482136@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124853.216621466@linuxfoundation.org> References: <20201228124853.216621466@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vincent Stehlé [ Upstream commit d0edaa28a1f7830997131cbce87b6c52472825d1 ] The DMA address returned by dma_map_single() should be checked with dma_mapping_error(). Fix the ps3stor_setup() function accordingly. Fixes: 80071802cb9c ("[POWERPC] PS3: Storage Driver Core") Signed-off-by: Vincent Stehlé Reviewed-by: Geert Uytterhoeven Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20201213182622.23047-1-vincent.stehle@laposte.net Signed-off-by: Sasha Levin --- drivers/ps3/ps3stor_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ps3/ps3stor_lib.c b/drivers/ps3/ps3stor_lib.c index 8c3f5adf1bc65..2d76183756626 100644 --- a/drivers/ps3/ps3stor_lib.c +++ b/drivers/ps3/ps3stor_lib.c @@ -201,7 +201,7 @@ int ps3stor_setup(struct ps3_storage_device *dev, irq_handler_t handler) dev->bounce_lpar = ps3_mm_phys_to_lpar(__pa(dev->bounce_buf)); dev->bounce_dma = dma_map_single(&dev->sbd.core, dev->bounce_buf, dev->bounce_size, DMA_BIDIRECTIONAL); - if (!dev->bounce_dma) { + if (dma_mapping_error(&dev->sbd.core, dev->bounce_dma)) { dev_err(&dev->sbd.core, "%s:%u: map DMA region failed\n", __func__, __LINE__); error = -ENODEV; -- 2.27.0