From patchwork Wed May 30 10:36:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10438367 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 39811601D3 for ; Wed, 30 May 2018 10:37:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28668287B4 for ; Wed, 30 May 2018 10:37:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1CEB428928; Wed, 30 May 2018 10:37:26 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, 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 E742D287B4 for ; Wed, 30 May 2018 10:37:23 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id F2ABD2676D7; Wed, 30 May 2018 12:37:19 +0200 (CEST) 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 F3AAA2676D8; Wed, 30 May 2018 12:37:17 +0200 (CEST) Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) by alsa0.perex.cz (Postfix) with ESMTP id BB77A2676D5 for ; Wed, 30 May 2018 12:37:13 +0200 (CEST) Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4UAZmbS061701; Wed, 30 May 2018 10:37:09 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=YKI5hpjJNC1vhlED8SeH9RPdzRhoDn5GvxQXjuDLv5Q=; b=AaUpWe3JH+CGKsS3KNs60+MjNWl8k//Tacx9M3a5oXOPV6gx7U/zd0ZbB7VqIFcTSLZE Bj0w40mGmzzu1REs5bfbIQPlTeLR+VIQhyVm/vhD5kqXf6+oSWbc/fgzHJzApZY+Ydf7 HObV/ivtdlolfEydwCFTUebuv14NFj6KymdZu/U/wu+EQQAln3qAvQ7QnLKblya5PeG9 yXSpP1h+b+2pB/EQW1KbvCLWaDb0+bF0h1ynx+1N3uaih5FG5G760B1wsA2lH6s/pXaF gw4mJPaNd4ynRUHEql5q9UGlSZp8aP8AfkxPtxt9OAEw+wf5nSmT+Qvbt1tWJtqM3wFt pA== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2120.oracle.com with ESMTP id 2j9ev89sup-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 May 2018 10:37:09 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w4UAb8bu011057 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 May 2018 10:37:08 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w4UAb5Od005797; Wed, 30 May 2018 10:37:07 GMT Received: from kili.mountain (/197.157.0.20) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 30 May 2018 03:37:04 -0700 Date: Wed, 30 May 2018 13:36:55 +0300 From: Dan Carpenter To: Oleksandr Andrushchenko Message-ID: <20180530103655.bnjzq2jpfrjjwvvj@kili.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170113 (1.7.2) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8908 signatures=668702 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=734 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1805300122 Cc: xen-devel@lists.xenproject.org, alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org, Takashi Iwai Subject: [alsa-devel] [PATCH] ALSA: xen-front: freeing an error pointer 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 kfree() doesn't accept error pointers so I've set "str" to NULL on these paths. Fixes: fd3b36045c2c ("ALSA: xen-front: Read sound driver configuration from Xen store") Signed-off-by: Dan Carpenter Reviewed-by: Oleksandr Andrushchenko diff --git a/sound/xen/xen_snd_front_cfg.c b/sound/xen/xen_snd_front_cfg.c index 38c7e1eefbb9..68dcd7d1f09e 100644 --- a/sound/xen/xen_snd_front_cfg.c +++ b/sound/xen/xen_snd_front_cfg.c @@ -306,6 +306,7 @@ static int cfg_get_stream_type(const char *path, int index, str = xenbus_read(XBT_NIL, stream_path, XENSND_FIELD_TYPE, NULL); if (IS_ERR(str)) { ret = PTR_ERR(str); + str = NULL; goto fail; } @@ -347,6 +348,7 @@ static int cfg_stream(struct xen_snd_front_info *front_info, str = xenbus_read(XBT_NIL, stream_path, XENSND_FIELD_TYPE, NULL); if (IS_ERR(str)) { ret = PTR_ERR(str); + str = NULL; goto fail; }