From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Jim Cromie <jim.cromie@gmail.com>,
jbaron@akamai.com,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH AUTOSEL 4.4 14/16] dyndbg: prefer declarative init in caller, to memset in callee
Date: Mon, 10 Aug 2020 15:14:41 -0400 [thread overview]
Message-ID: <20200810191443.3795581-14-sashal@kernel.org> (raw)
In-Reply-To: <20200810191443.3795581-1-sashal@kernel.org>
From: Jim Cromie <jim.cromie@gmail.com>
[ Upstream commit 9c9d0acbe2793315fa6945a19685ad2a51fb281b ]
ddebug_exec_query declares an auto var, and passes it to
ddebug_parse_query, which memsets it before using it. Drop that
memset, instead initialize the variable in the caller; let the
compiler decide how to do it.
Acked-by: <jbaron@akamai.com>
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Link: https://lore.kernel.org/r/20200719231058.1586423-10-jim.cromie@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
lib/dynamic_debug.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index f50d63f67899a..953d81d58fe76 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -318,7 +318,6 @@ static int ddebug_parse_query(char *words[], int nwords,
pr_err("expecting pairs of match-spec <value>\n");
return -EINVAL;
}
- memset(query, 0, sizeof(*query));
if (modname)
/* support $modname.dyndbg=<multiple queries> */
@@ -436,7 +435,7 @@ static int ddebug_parse_flags(const char *str, unsigned int *flagsp,
static int ddebug_exec_query(char *query_string, const char *modname)
{
unsigned int flags = 0, mask = 0;
- struct ddebug_query query;
+ struct ddebug_query query = {};
#define MAXWORDS 9
int nwords, nfound;
char *words[MAXWORDS];
--
2.25.1
next prev parent reply other threads:[~2020-08-10 19:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-10 19:14 [PATCH AUTOSEL 4.4 01/16] drm/tilcdc: fix leak & null ref in panel_connector_get_modes Sasha Levin
2020-08-10 19:14 ` [PATCH AUTOSEL 4.4 02/16] Bluetooth: add a mutex lock to avoid UAF in do_enale_set Sasha Levin
2020-08-10 19:14 ` [PATCH AUTOSEL 4.4 03/16] fs/btrfs: Add cond_resched() for try_release_extent_mapping() stalls Sasha Levin
2020-08-11 7:57 ` David Sterba
2020-08-11 13:47 ` Paul E. McKenney
2020-08-10 19:14 ` [PATCH AUTOSEL 4.4 04/16] drm/radeon: Fix reference count leaks caused by pm_runtime_get_sync Sasha Levin
2020-08-10 19:14 ` [PATCH AUTOSEL 4.4 05/16] video: fbdev: neofb: fix memory leak in neo_scan_monitor() Sasha Levin
2020-08-10 19:14 ` [PATCH AUTOSEL 4.4 06/16] drm/nouveau: fix multiple instances of reference count leaks Sasha Levin
2020-08-10 19:14 ` [PATCH AUTOSEL 4.4 07/16] drm/debugfs: fix plain echo to connector "force" attribute Sasha Levin
2020-08-10 19:14 ` [PATCH AUTOSEL 4.4 08/16] mm/mmap.c: Add cond_resched() for exit_mmap() CPU stalls Sasha Levin
2020-08-10 19:14 ` [PATCH AUTOSEL 4.4 09/16] brcmfmac: To fix Bss Info flag definition Bug Sasha Levin
2020-08-10 19:14 ` [PATCH AUTOSEL 4.4 10/16] iwlegacy: Check the return value of pcie_capability_read_*() Sasha Levin
2020-08-10 19:14 ` [PATCH AUTOSEL 4.4 11/16] usb: gadget: net2280: fix memory leak on probe error handling paths Sasha Levin
2020-08-10 19:14 ` [PATCH AUTOSEL 4.4 12/16] bdc: Fix bug causing crash after multiple disconnects Sasha Levin
2020-08-10 19:14 ` [PATCH AUTOSEL 4.4 13/16] dyndbg: fix a BUG_ON in ddebug_describe_flags Sasha Levin
2020-08-10 19:14 ` Sasha Levin [this message]
2020-08-10 19:14 ` [PATCH AUTOSEL 4.4 15/16] bcache: fix super block seq numbers comparision in register_cache_set() Sasha Levin
2020-08-10 19:14 ` [PATCH AUTOSEL 4.4 16/16] ACPICA: Do not increment operation_region reference counts for field units Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200810191443.3795581-14-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jbaron@akamai.com \
--cc=jim.cromie@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®