Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp879474ybl; Wed, 11 Dec 2019 08:56:10 -0800 (PST) X-Google-Smtp-Source: APXvYqzvpdPoH47W71L1p3U4pFH7g5Vxwd5LUH5M16WnJognQQxtCpRARCggxX8EpCPv8vLxyeWE X-Received: by 2002:aca:1e0e:: with SMTP id m14mr3647661oic.114.1576083370736; Wed, 11 Dec 2019 08:56:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576083370; cv=none; d=google.com; s=arc-20160816; b=ImKWoD0Xts5cFFzO5j/P6LX+c404vFdL0zjXNDfvrWZTPD8SJsRQxL3/I0XvuPbkA4 pxRh28ptOL71fykt/vLp2SAoN83AihNxzY0EkEdcDJKDWmEEpZsESU94KOrtP4TTMbhy deBiexs6V05dAtDRhy3R2VV+KRnQ6yk4bRuP0ZY+tUabO4eNCUFVkcluD+CO40j8jjJt zFlZIPqrd9FUU94XqkRg8tqplYVKAy5lY4EaTkkv7epW8gIVwrknMKr0TA/nAgRAOJKE G2z4VDg6x9uTLDALu3OiCKGFgSEAiUiM4CeIStyixcjqc6xzcQ4nlxOpIzge4phAjxAj 9Y7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:in-reply-to:subject:cc:to:from :date; bh=maVb/85g+GJE3NUiq2aK2HvAKKXHRtA9VM65N/AZ350=; b=jAShn7Fv01DspBzeym9M1vSkPkmtzf/fjUR7UASMZ/Bbs37/TpYX/h5AWQHIZYXMQ2 +GQQKNth76QbNyfZShXNJkS0Ufb5ruiiYTO9V1ZdApDzEhtoJREiG+5SzjtrT8/z9D2y XmJQJ9EI9fCDD6DNntutT7vq1kkebVRQao5YmXKJkbdRg4rO8VQJvgDvCwCRdNXRfSY8 tMaAqHesmxS8l1GNazitiV0VXSUxPybl86V5n7CF8d2fH/HpbZdBPXimUSzfgeP7/aPq C0Kyjfa12x/gXrKrVev3ROO5Zhy14VjhirLGhwwWvo/NztPFT+XTiaEf0AKKg/zTObgs 2jKQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 p26si1467961oto.240.2019.12.11.08.55.56; Wed, 11 Dec 2019 08:56:10 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730711AbfLKQzQ (ORCPT + 99 others); Wed, 11 Dec 2019 11:55:16 -0500 Received: from foss.arm.com ([217.140.110.172]:39450 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727118AbfLKQzQ (ORCPT ); Wed, 11 Dec 2019 11:55:16 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4AEA930E; Wed, 11 Dec 2019 08:55:15 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BF4CF3F52E; Wed, 11 Dec 2019 08:55:14 -0800 (PST) Date: Wed, 11 Dec 2019 16:55:13 +0000 From: Mark Brown To: Aditya Pakki Cc: kjlu@umn.edu, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, Mark Brown , pakki001@umn.edu Subject: Applied "spi: dw: Avoid BUG_ON() in case of host failure" to the spi tree In-Reply-To: <20191205231421.9333-1-pakki001@umn.edu> Message-Id: X-Patchwork-Hint: ignore Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch spi: dw: Avoid BUG_ON() in case of host failure has been applied to the spi tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-5.6 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 169f9acae08685d4f2a6fd32983958d44e10905d Mon Sep 17 00:00:00 2001 From: Aditya Pakki Date: Thu, 5 Dec 2019 17:14:21 -0600 Subject: [PATCH] spi: dw: Avoid BUG_ON() in case of host failure If dws is NULL in dw_spi_host_add(), we return the error to the upper callers instead of crashing. The patch replaces BUG_ON by returning -EINVAL to the caller. Signed-off-by: Aditya Pakki Link: https://lore.kernel.org/r/20191205231421.9333-1-pakki001@umn.edu Signed-off-by: Mark Brown --- drivers/spi/spi-dw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index a92aa5cd4fbe..a160d9a141ea 100644 --- a/drivers/spi/spi-dw.c +++ b/drivers/spi/spi-dw.c @@ -460,7 +460,8 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws) struct spi_controller *master; int ret; - BUG_ON(dws == NULL); + if (!dws) + return -EINVAL; master = spi_alloc_master(dev, 0); if (!master) -- 2.20.1