From patchwork Wed Oct 19 03:35:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ye Bin X-Patchwork-Id: 319 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp104459wrs; Tue, 18 Oct 2022 20:20:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6wDSwekxYTH8MJNRHTY95dSvhqHmdPYGAVouVfFlsF/8JRtm+Z6kkLIWA/UPVJPo7HCQtn X-Received: by 2002:a05:6402:1caa:b0:458:d825:95b5 with SMTP id cz10-20020a0564021caa00b00458d82595b5mr5421369edb.95.1666149638455; Tue, 18 Oct 2022 20:20:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666149638; cv=none; d=google.com; s=arc-20160816; b=XE3n4HqGJ/xqnuGZohtIDn46mx/5ck+lA58VlhCiL3t1OgyVZ3q1lGP+lv+D1p1msQ l5om+Iy1T3axv3GzWKJ7JUEUDYWNhotQn28+PQx7flEgdAABVN0zuNelZTuNLlnS4KPJ hfhtEgUsVbKY38vk2S2F5Wv2MEr+2m9rYcmzMywFFLMGOyHiyMAdyrsAhQr14TTV5ooT eXYsX11/cxQSqAfzSWWlfj8veL6iGJDWEjPSzeqSTlukhgUX519ON7flQZaorLuo1UTM DiVPFDK1bgU2gda5290PiT6r/sJ+pYmE+UK/5y19NaNYdBrcLCzK9ZlTImLmjxdg1ulw fSgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=uE0wm3VZiO5LndswmEaPDaaSfuG2QDmf0GD1k+4RswU=; b=UTOlRmrZpyKYD1vztfViMuX2Mk1x4xhC91EAA32ZKYSRDHCtCCqxj1IdOipuWEqi6O B7vF+CL2emQDTYVwo4SPjIxqZb0EhQWFa8nX6HOz9YA7DzcDlLw6dOQ7TB9vdr74sROA z8+1Gaym7YG0g/13UEpz5feyVspBrmYDMrk7NGU22ARcPRbuh797gWHznkTXT/erKCxe 7dJc9ACbtYySk46wBm1t8AIroQOcaoZDMJDz/wqr2K4/HWL0rPUe4otW1TATBOfYHSuS jtrvNTMDk2j3Fz9MfxfUGt0PXEDFIL6Rgz6z7GDIZBBAwtmBSUh2eBgfpKXj9AF6mqbk gbrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lg22-20020a170906f89600b0078c959aea8bsi10918479ejb.324.2022.10.18.20.19.49; Tue, 18 Oct 2022 20:20:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229848AbiJSDOH (ORCPT + 99 others); Tue, 18 Oct 2022 23:14:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229885AbiJSDOC (ORCPT ); Tue, 18 Oct 2022 23:14:02 -0400 Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A56BB165A8; Tue, 18 Oct 2022 20:14:01 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4MsbNp6y3Tz6R520; Wed, 19 Oct 2022 11:11:38 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP4 (Coremail) with SMTP id gCh0CgDnLS53a09jvmtUAA--.10775S4; Wed, 19 Oct 2022 11:13:59 +0800 (CST) From: Ye Bin To: axboe@kernel.dk, rostedt@goodmis.org, mhiramat@kernel.org, linux-block@vger.kernel.org Cc: linux-kernel@vger.kernel.org, yebin@huaweicloud.com, Ye Bin Subject: [PATCH v3 0/3] fix possible memleak in '__blk_trace_remove' Date: Wed, 19 Oct 2022 11:35:59 +0800 Message-Id: <20221019033602.752383-1-yebin@huaweicloud.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CM-TRANSID: gCh0CgDnLS53a09jvmtUAA--.10775S4 X-Coremail-Antispam: 1UD129KBjvdXoWrZFyfAw1rJFyUKw13Gr4kZwb_yoWxZrX_JF WrXas7Gr13GFn8tFWfJF1DJ34qgrW7ur18X3WUtrW5AwnrXry5XFnFy398Wr1IvF4kXFW7 ZrsxG348C3WayjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbwAFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6r1j6r18M7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Cr1j 6rxdM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s 0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xII jxv20xvE14v26r106r15McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr 1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxAIw28IcxkI7VAKI48J MxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwV AFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6xIIjxv2 0xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4 v20xvaj40_WFyUJVCq3wCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E 14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x0JUZa9-UUUUU= X-CM-SenderInfo: p1hex046kxt4xhlfz01xgou0bp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747084523049010708?= X-GMAIL-MSGID: =?utf-8?q?1747084523049010708?= From: Ye Bin Diff v3 VS v2 1. Invert the check of 'blk_trace_{start,stop}' and return early from the function for the error case. Diff v2 VS v1: 1. Introduce 'blk_trace_{start,stop}' helper instead of 'blk_trace_switch_state'. 2. Move stop block trace from '__blk_trace_remove' to 'blk_trace_cleanup'. Ye Bin (3): blktrace: introduce 'blk_trace_{start,stop}' helper blktrace: fix possible memleak in '__blk_trace_remove' blktrace: remove unnessary stop block trace in 'blk_trace_shutdown' kernel/trace/blktrace.c | 82 ++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 43 deletions(-)