From patchwork Tue Jul 4 19:43:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li zeming X-Patchwork-Id: 115180 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp255894vqx; Sun, 2 Jul 2023 20:22:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6cjOM7R/HV2whTPWnuFLsqCK3UXha4QJnQx4CYc7r7hIUwF9vU+Z99ZgK9tcR6DGtsmKsV X-Received: by 2002:a05:6a20:8f03:b0:116:696f:1dd1 with SMTP id b3-20020a056a208f0300b00116696f1dd1mr14419281pzk.4.1688354561672; Sun, 02 Jul 2023 20:22:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688354561; cv=none; d=google.com; s=arc-20160816; b=uFmCY1gn57y79kpZwf80LzIvYtc+jql6kDRtaqYVJS8EeXm4VdhwCniCBgAMBdsATx 5GTPaqs8MWLVDr4WIKg0T2HoOtIjludCQ7H5Z+xaicbB3G8IOAUsj8hFp75apxvoWMHy KCUWZe4Ugjt2XH01pPHQjHsPlitWmC4rCxUuOEv6hX9nDtvPoqbpwpmg2fXSZxBPP6Uy D6Z6Ffbn5WPgiT3PoMptx2p/IRzWY+Xq0G90Adg1QvXmUB/eW5vhWR4gU3xqWCLr9NIK NkgzdOZxHE4cC4rWtdc538gFyYX05qrxCVd6bDd7FF/fNAQPtrnZb8WZlKCZCK6r4jPs o6yg== 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=Kw3nDq6mFbf/OWB//GugbSqRVJvFUW+LM8bmSRp+xVQ=; fh=MDcLyW7gnQ7zhVrwu4ydSY34K8iXsxgpLnkzEl2cuwA=; b=v3sweAQNsTfQ1ZAo8KPuMbRZZrGzkjsKR47esG7aB5HBi7nWWSsvB5EFppvaKKlMn3 HqOr9BrHP422Fa1Gv56EcHbW0u8DFqg79hZvrh1ADpK3LJe8RvERxkD9gbAqnlYRmt8y V2EOvixK8QrOPnA7vSzuzSJuD3Whya8JCSu/TPcN/mioVjUtle889zysnp0w+MeOb+ME C0VeUojdr2mEriYDeKaA8RZdHuKkJ71uyrddZzje4hmkAXvcOpVMuHWl6XRqmyPnM90i 9XBWVg5zdfCDu6XJ2/Rvg0kXm46D77QRcS5EYByjbB+GMdHDS82dMJG1P/8MbG7wXFeC tjHQ== 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 bs126-20020a632884000000b0055b766191f4si1470933pgb.218.2023.07.02.20.22.29; Sun, 02 Jul 2023 20:22:41 -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 S229922AbjGCDMo (ORCPT + 99 others); Sun, 2 Jul 2023 23:12:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229554AbjGCDMn (ORCPT ); Sun, 2 Jul 2023 23:12:43 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 0CFBA1BE; Sun, 2 Jul 2023 20:12:40 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id A79E76096E8F9; Mon, 3 Jul 2023 11:12:39 +0800 (CST) X-MD-Sfrom: zeming@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li zeming To: naveen.n.rao@linux.ibm.com, anil.s.keshavamurthy@intel.com, davem@davemloft.net, mhiramat@kernel.org Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Li zeming Subject: [PATCH] =?utf-8?q?kprobes=3A_Remove_unnecessary_=E2=80=98NULL?= =?utf-8?q?=E2=80=99_values_from_correct=5Fret=5Faddr?= Date: Wed, 5 Jul 2023 03:43:59 +0800 Message-Id: <20230704194359.3124-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_24_48, RDNS_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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?1770368072730431916?= X-GMAIL-MSGID: =?utf-8?q?1770368072730431916?= The 'correct_ret_addr' pointer is always set in the later code, no need to initialize it at definition time. Signed-off-by: Li zeming Acked-by: Masami Hiramatsu (Google) --- kernel/kprobes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/kprobes.c b/kernel/kprobes.c index db8a3aa53cf6..ec50f9f380c1 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -2007,9 +2007,9 @@ void __weak arch_kretprobe_fixup_return(struct pt_regs *regs, unsigned long __kretprobe_trampoline_handler(struct pt_regs *regs, void *frame_pointer) { - kprobe_opcode_t *correct_ret_addr = NULL; struct kretprobe_instance *ri = NULL; struct llist_node *first, *node = NULL; + kprobe_opcode_t *correct_ret_addr; struct kretprobe *rp; /* Find correct address and all nodes for this frame. */