Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9092340pxu; Mon, 28 Dec 2020 06:27:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJOEFKuJi8K5aEkPRVWz+ExQ1uV7JqLpF/fh0x8i7HgyMy7KLj+EzaHjSFNIOaZzds/CfE X-Received: by 2002:a17:906:85cd:: with SMTP id i13mr41789778ejy.553.1609165631951; Mon, 28 Dec 2020 06:27:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609165631; cv=none; d=google.com; s=arc-20160816; b=DBohgrX/+LAOIXpUFaUH9wccHIRPz/ZaZ3sbj1I7ntMF7YjaJYGAznxrHRlgqu7+Yf 9Tt5UqzVzql5KAcX90QupNq/M/N/S596XUH8m3Ws/Xjn+Q4xnfYGDyQxs2fs6OGvStqF w/eqYfvMbwyDtCpkPp6Mpby2xVrqFjOAhj7KFhIFt1K1OtNr5zRbVuwGNBUlCUP0o2/X 6T/Exi1AkupHu7/mdgSJHzCGEObOqrX5ml8C68IMpqXzLPAAmxLWTHeahZ1qUrGhxEHJ us9Z8Z9HlIbZ7ZY3JJmakC8deKquWMRHJPnEoXGGQjqWgVs/hJooixLlXevXBMiQmzyx GKAg== 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=G8X7KsB67YkqpBWJWwVeN4k7icteyqE+q+1cr1UFLOw=; b=lkUjRF1EK2zxf087r3m87yNsgSLEs3MIbegRQfT4olz3PHJ8zc0o4i0epFtw6wlgcM R18mL/jm99k665JZP0kMrzbQaHOKTieRrNZri1XTmRWpgGCYH2nVRS5H2GqzA/ga6saW zlLMkbvd8shlSnqDskkhVtlevVKrkY3oTcz5fdeAUrMiy7pqWWAzcXps+PNOhQrzgWdE F/js5Dgdtes7qAe58hNGUI1Erjbla38+8VkNS8p0DEvVD6J5e8s1gTxA9R0+6g+0r85C 8H5gf99GX0hTXeh5Iy/rMS6eWh8DTuZ7ZXOSsdws1iC0PtarIyUPhuVNeVkug5LO80Dc 5YIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VhWDQx6L; 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 b12si22082353edq.488.2020.12.28.06.26.48; Mon, 28 Dec 2020 06:27:11 -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=VhWDQx6L; 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 S2440620AbgL1OVx (ORCPT + 99 others); Mon, 28 Dec 2020 09:21:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:56840 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502581AbgL1OVX (ORCPT ); Mon, 28 Dec 2020 09:21:23 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0C16422AAA; Mon, 28 Dec 2020 14:20:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165236; bh=1nDgGknWBmv1BH/g6hqZLjhfPhhRHpLAfYTIg+dyEIc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VhWDQx6L1s23HC8OuZxeyCK/pdPrpt605AwT0VUMDId4rXM/vo0m6WGzzp67W2mH0 wRFV8KHCl9D/Ayegy/A0cDkU7vsueF+/WfIwTbd2YWo0zXUtSRMQJM910/bFVEY+08 W4bVCMcT5ZpEqKHrmIu6LJnwSWwySOwzR9kYlP8E= 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 5.10 443/717] powerpc/ps3: use dma_mapping_error() Date: Mon, 28 Dec 2020 13:47:21 +0100 Message-Id: <20201228125042.194295189@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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 333ba83006e48..a12a1ad9b5fe3 100644 --- a/drivers/ps3/ps3stor_lib.c +++ b/drivers/ps3/ps3stor_lib.c @@ -189,7 +189,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