From patchwork Tue Jan 9 09:26:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10151283 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 737DD60223 for ; Tue, 9 Jan 2018 09:28:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78BC928560 for ; Tue, 9 Jan 2018 09:28:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DD1B286C7; Tue, 9 Jan 2018 09:28:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B69F128560 for ; Tue, 9 Jan 2018 09:28:01 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 0FA962675D2; Tue, 9 Jan 2018 10:28:00 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id DBC252675D4; Tue, 9 Jan 2018 10:27:58 +0100 (CET) Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by alsa0.perex.cz (Postfix) with ESMTP id 6A23626717C for ; Tue, 9 Jan 2018 10:27:55 +0100 (CET) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w099RmQ4139412; Tue, 9 Jan 2018 09:27:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2017-10-26; bh=hLKeLu1hEkeulkwW7RQXGqtOlWXrvxe7O1uJzHZYpjg=; b=TxWT4tRx3m1xkTO6HffDQMqKzNiY42oTai/ALKU1uPqItRu2fqnSWDYxxkkdXFLAhxQ/ yXWn2kWLEgXSsYMyihiZmk1eWZQCDwLM6PYuapKBeogZiDPo5G9o+29/d1z+UHwtYhys C988mv6l7UZ0hgaKyWYrrroI8k/gf3OahZRFokLDLLrqVhC9xbVAY4IcobfwTrXAKl+O 40Ib+Ly700NFvHr5E7ebpQ0yKP9Unq8NudMN1qgz+/ko7PvwY0+hmqTuVC4kXbRImmIr 30rKpB1u1QrEq6vFYorB7SYkVwvxS2TLYzZUWfD2Od4DNvDfkD4E71lVi1WVYjaoS9Gd SQ== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2fcsmfgaq5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 09 Jan 2018 09:27:53 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w099QPvk018646 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 9 Jan 2018 09:26:26 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w099QOH0013373; Tue, 9 Jan 2018 09:26:25 GMT Received: from mwanda (/197.157.34.162) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 09 Jan 2018 01:26:24 -0800 Date: Tue, 9 Jan 2018 12:26:16 +0300 From: Dan Carpenter To: Srinivas Kandagatla , Sagar Dharia Message-ID: <20180109092616.mfha2rs56oaxfjaz@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8768 signatures=668652 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=846 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801090133 Cc: Greg Kroah-Hartman , alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH 1/2] slimbus: qcom-ctrl: fix a NULL test X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP "retries" ends when it is set to -1 and not 0 so that part of the test is wrong. This bug would lead to a NULL dereference a couple lines later. Fixes: afbdcc7c384b ("slimbus: Add messaging APIs to slimbus framework") Signed-off-by: Dan Carpenter --- Should Greg be added to the MAINTAINERS file for this driver? diff --git a/drivers/slimbus/qcom-ctrl.c b/drivers/slimbus/qcom-ctrl.c index fb1a5e0eb8dd..3ab59209cbdc 100644 --- a/drivers/slimbus/qcom-ctrl.c +++ b/drivers/slimbus/qcom-ctrl.c @@ -345,7 +345,7 @@ static int qcom_xfer_msg(struct slim_controller *sctrl, } } - if (!retries && !pbuf) + if (!pbuf) return -ENOMEM; puc = (u8 *)pbuf;