Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9045456pxu; Mon, 28 Dec 2020 05:18:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxTI1q1X/zr6aN9eYnNhuGaKihUNs9hcdGe+HPqBUxHGbJzaJbdntKz4tZnfGgDZh+p1af X-Received: by 2002:a17:906:d0c2:: with SMTP id bq2mr41543063ejb.1.1609161487317; Mon, 28 Dec 2020 05:18:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609161487; cv=none; d=google.com; s=arc-20160816; b=BPEjneLZ7O2S7ead54DGXpSPhuYxHFgpvGwwr3kkJ959FwLfvrFovMaPDcO15aeTts z/atBmjqKqvT7xTB205xLN8NV0jH8qLsXjcsGyaScrbp/WT/XjLyiYDecWmZivfGP0+v Hv+bALv4IU4skmwd1hsZA+EEDh4ySIkbGZLQxAje5as3PezOesPEr/4axIbPUx2xwzmX 79UuJWH495d5mNBEK8iFoa1mhiXRF0MWMosUJhGr6DUDw6JVJkM9wKbruRhWBGWUDJHE 7Xrcrw9kST5yu4kWRSqCA7eVrf0fJD1L+/CbP4IFhKFN8xChfMUYn6ed2zPxrspNGVKi KVpQ== 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=pSMZ0ffCH/t0WnKTQ9nW/b4BxPOYNxtYYRha0o8ux2BF/us+i96nGFb+IEIOpThWzN CUmdNkw1wVgL6nQtgSEthlPPdriCtpRRo+D5rGdDWZoYiJpUudmfR317bf4h+QO0ENnN szqWSHOEpAKcUe8EksUTyIi99oFM4flUp48NSllPLh1D9TTfKjS3+tpe/SHJlS/eJKGU EYelEVg3YIEyV/rk+DaBg/7U8WOTljtSG39u2P+amxT5DbbMJxz6nnB6Q8VDPhTMOq7m qlYk1u7mX4F9JSEaKdV9uH4IUzeWsu3xh3kRdtQEHoU8gXl71aUHkCPvs155SqxaaQlq RzlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ojGxat2d; 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 30si20923590edv.385.2020.12.28.05.17.44; Mon, 28 Dec 2020 05:18:07 -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=ojGxat2d; 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 S1732713AbgL1NPi (ORCPT + 99 others); Mon, 28 Dec 2020 08:15:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:43642 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732680AbgL1NPY (ORCPT ); Mon, 28 Dec 2020 08:15:24 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 55C40206ED; Mon, 28 Dec 2020 13:14:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161284; bh=UAFTBRjOWayQArKHk2ibWenA7R1IHmPQWIiHUJtUm0M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ojGxat2d3iVMyPIsNcsqfcKiBjpK55peG7ezNHcs+G9HmHzkVE5NepXoZoqsVbfIJ Tk7z6KC7jU8nym6NhcYnac1aTeDyz2mXUGOH9An/5/LVeSpPON29Z0tW5oinijkJ+p ovVzOQ52ipYIkq9HIuj3MZyIC/cMSi1rviEJhWzs= 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.14 163/242] powerpc/ps3: use dma_mapping_error() Date: Mon, 28 Dec 2020 13:49:28 +0100 Message-Id: <20201228124912.723080100@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@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