Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp132600pxa; Tue, 4 Aug 2020 18:58:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdDlVaWzMKc5ij56jwUpv49xYtSk3fdPt1cfGnyR/EgUkG2Xal3lewZd75FvPmPcStNElm X-Received: by 2002:a17:906:8149:: with SMTP id z9mr971283ejw.356.1596592734169; Tue, 04 Aug 2020 18:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596592734; cv=none; d=google.com; s=arc-20160816; b=U986StD7ktNdwBm465untftRGt566udhMFMI1GERjUbIPfzNOA4ijwMCoSD2Uuc9HH Z3a3EkTt8ReJk0d4a3JcGffRhyzP2B6Km8oPqhRIsPA7kyseNQrrj3nLZY1NC385UTpL XOf9njp6zKjzOVJV7wxsBRoNiMxaQb94QhRUROCyvFzQTEKydgU3ck7vqqnyCqpn6Hgu fVJQOtdagYJdU+n018Nsfm4hpuX/msMzXuRW70wSJLbeKXxUFmXeZuBiSy/OtfLbUxEZ v8xIh9txVipbzbCD4ab2PBnwn3Z7++qdlvsGhLJOarXFCsdp8Oxd8vKd4eTKujovtTOM jY3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=HW12Wd1UPnuMm0XelSypiCjqWSC4y9YwYeSS/msufQM=; b=DdFD6ncYZgDzT0JsXRKIYyT01KKfYNys9FDHsFZCS4m/IpegfQwfNX596thvHmt5YK fT3+rdmIcFRvvMs2jK9d5JlWV/zua6X6UXIRNyh2xSi0ThJIo62l4ZkWo4SulaO5pQYx 9UFcUG2QkHeovdrDmwD1yyT/Xtdw5DyncySNGQNIPCMv4T4Pr1bTIoQb2dXZb4rTzNPW sH8U5HwuP8YyGJPYr4KH2yys7fT5utG/wTAXlyWeIfA3Q+lPnq00s8lF/UUuHdjTKafo g+UgFaONN+HPZy6KQRraYqnVU+SRRoS5UB9bAlxat8ijDeDpZq2iVDl434kIk7NdEdeN fd+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b35si354526edf.41.2020.08.04.18.58.18; Tue, 04 Aug 2020 18:58:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726011AbgHEB6R (ORCPT + 99 others); Tue, 4 Aug 2020 21:58:17 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:50712 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725981AbgHEB6R (ORCPT ); Tue, 4 Aug 2020 21:58:17 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 333DC5996704AFF08E50; Wed, 5 Aug 2020 09:58:10 +0800 (CST) Received: from [127.0.0.1] (10.74.173.29) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Wed, 5 Aug 2020 09:58:00 +0800 Subject: Re: [PATCH v4 01/10] crypto: hisilicon/qm - fix wrong release after using strsep To: Markus Elfring , Sihang Chen , References: <96ffa633-dda1-7ad1-72da-5563906c1561@web.de> CC: , , "David S. Miller" , Herbert Xu , Zaibo Xu , Zhou Wang From: "shenyang (M)" Message-ID: <425f4bdd-cf55-6537-28bf-0377564b531b@huawei.com> Date: Wed, 5 Aug 2020 09:58:00 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <96ffa633-dda1-7ad1-72da-5563906c1561@web.de> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.74.173.29] X-CFilter-Loop: Reflected Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 2020/8/5 2:34, Markus Elfring wrote: > … >> +++ b/drivers/crypto/hisilicon/qm.c >> @@ -1420,16 +1420,17 @@ static int qm_dbg_help(struct hisi_qm *qm, char *s) > … >> + s_tmp = s; >> presult = strsep(&s, " "); >> if (!presult) { >> - kfree(s); >> + kfree(s_tmp); >> return -EINVAL; >> } > > - kfree(s); > - return -EINVAL; > + ret = -EINVAL; > + goto free_tmp; > > I suggest to add a jump target for the desired exception handling. > > Regards, > Markus > > . > Thanks for your review. There is only one error branch need to do something uninit. So I think the jump is not necessary and will affect code reading.:) Thanks, Yang