From patchwork Tue Jan 8 07:43:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10751523 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 527F914E5 for ; Tue, 8 Jan 2019 07:45:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CD5028B6A for ; Tue, 8 Jan 2019 07:45:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2AC8328B6D; Tue, 8 Jan 2019 07:45:09 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=ham 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 3BE8D28B6A for ; Tue, 8 Jan 2019 07:45:07 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id EAA51266829; Tue, 8 Jan 2019 08:45:05 +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 6800C266860; Tue, 8 Jan 2019 08:45:03 +0100 (CET) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by alsa0.perex.cz (Postfix) with ESMTP id 4F1B22667F5 for ; Tue, 8 Jan 2019 08:44:58 +0100 (CET) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x087dDMM093965; Tue, 8 Jan 2019 07:44:57 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 : in-reply-to; s=corp-2018-07-02; bh=5QMhHnkimBX11hFitbQdy2QgW2ac3jz1HmbUI0uOnzo=; b=Bk+YlWEJDcuVpbA9YRR/oy81WSCG94InGlQYCvNOmTNc7tBbxUhBB8q0EW2hb+t6N39N EuFVUz+qFeb9vl2pOcZg7NgHP9VGxaG2Q8vD3R5AUkUwU2OABRfKd7wyP57DB4/a4jqk RcgdQVcDIcovG08lgtecc+XUsgel7cGAt/+MRB8jP24pwM1Q0WHtZ9QgczeA0P2ctuou hkU+bHl7e5gmwf6R9oTF3isLNql37DCAgph+yddLUY2KdVi3nV+TlK/lqx5XFIofqZMb O1cQNgEYNx+0K+4cskMl7LjRpQGchbbMZh48jq6Szx/yjtv+bUnqaPvYg53GWVIHKUu7 kw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2ptm0u1w0s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 08 Jan 2019 07:44:56 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x087itcP018506 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Jan 2019 07:44:55 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x087ipp3006648; Tue, 8 Jan 2019 07:44:54 GMT Received: from kadam (/10.175.22.59) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 07 Jan 2019 23:44:50 -0800 Date: Tue, 8 Jan 2019 10:43:30 +0300 From: Dan Carpenter To: Jaroslav Kysela Message-ID: <20190108074330.GA20166@kadam> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1546895293273.10834@ece.ufl.edu> X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9129 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901080063 Cc: security@kernel.org, Vinod Koul , Takashi Iwai , alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH] ALSA: cs46xx: Potential NULL dereference in probe 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 The "chip->dsp_spos_instance" can be NULL on some of the ealier error paths in snd_cs46xx_create(). Reported-by: "Yavuz, Tuba" Signed-off-by: Dan Carpenter --- We don't really consider NULL derefences as security bugs unless they can be triggered remotely, but it's definitely worth fixing. sound/pci/cs46xx/dsp_spos.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/pci/cs46xx/dsp_spos.c b/sound/pci/cs46xx/dsp_spos.c index 598d140bb7cb..5fc497c6d738 100644 --- a/sound/pci/cs46xx/dsp_spos.c +++ b/sound/pci/cs46xx/dsp_spos.c @@ -903,6 +903,9 @@ int cs46xx_dsp_proc_done (struct snd_cs46xx *chip) struct dsp_spos_instance * ins = chip->dsp_spos_instance; int i; + if (!ins) + return 0; + snd_info_free_entry(ins->proc_sym_info_entry); ins->proc_sym_info_entry = NULL;