From: Dan Carpenter <dan.carpenter@oracle.com>
To: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
kgdb-bugreport@lists.sourceforge.net, dcb314@hotmail.com,
jason.wessel@windriver.com, wharms@bfs.de
Subject: Re: [PATCH] kernel/debug/kdb/kdb_bp.c: fix argument range check
Date: Tue, 22 Jul 2014 07:53:13 +0000 [thread overview]
Message-ID: <20140722075207.GN25880@mwanda> (raw)
In-Reply-To: <1405705224-32171-1-git-send-email-andrey.krieger.utkin@gmail.com>
On Fri, Jul 18, 2014 at 08:40:24PM +0300, Andrey Utkin wrote:
> Dropped negativity check; enhanced upper limit check as proposed by
> Walter Harms <wharms@bfs.de>
>
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id€591
> Reported-by: David Binderman <dcb314@hotmail.com>
> Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
> ---
> kernel/debug/kdb/kdb_bp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/debug/kdb/kdb_bp.c b/kernel/debug/kdb/kdb_bp.c
> index 70a5046..371150f 100644
> --- a/kernel/debug/kdb/kdb_bp.c
> +++ b/kernel/debug/kdb/kdb_bp.c
> @@ -39,7 +39,7 @@ static char *kdb_rwtypes[] = {
>
> static char *kdb_bptype(kdb_bp_t *bp)
> {
> - if (bp->bp_type < 0 || bp->bp_type > 4)
> + if (bp->bp_type >= ARRAY_SIZE(kdb_rwtypes))
> return "";
I like this version of the patch because it silences the static checker
warning like the first one does but it also makes the code more
readable.
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
kgdb-bugreport@lists.sourceforge.net, dcb314@hotmail.com,
jason.wessel@windriver.com, wharms@bfs.de
Subject: Re: [PATCH] kernel/debug/kdb/kdb_bp.c: fix argument range check
Date: Tue, 22 Jul 2014 10:53:13 +0300 [thread overview]
Message-ID: <20140722075207.GN25880@mwanda> (raw)
In-Reply-To: <1405705224-32171-1-git-send-email-andrey.krieger.utkin@gmail.com>
On Fri, Jul 18, 2014 at 08:40:24PM +0300, Andrey Utkin wrote:
> Dropped negativity check; enhanced upper limit check as proposed by
> Walter Harms <wharms@bfs.de>
>
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=80591
> Reported-by: David Binderman <dcb314@hotmail.com>
> Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
> ---
> kernel/debug/kdb/kdb_bp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/debug/kdb/kdb_bp.c b/kernel/debug/kdb/kdb_bp.c
> index 70a5046..371150f 100644
> --- a/kernel/debug/kdb/kdb_bp.c
> +++ b/kernel/debug/kdb/kdb_bp.c
> @@ -39,7 +39,7 @@ static char *kdb_rwtypes[] = {
>
> static char *kdb_bptype(kdb_bp_t *bp)
> {
> - if (bp->bp_type < 0 || bp->bp_type > 4)
> + if (bp->bp_type >= ARRAY_SIZE(kdb_rwtypes))
> return "";
I like this version of the patch because it silences the static checker
warning like the first one does but it also makes the code more
readable.
regards,
dan carpenter
next prev parent reply other threads:[~2014-07-22 7:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-18 17:40 [PATCH] kernel/debug/kdb/kdb_bp.c: fix argument range check Andrey Utkin
2014-07-18 17:40 ` Andrey Utkin
2014-07-22 7:53 ` Dan Carpenter [this message]
2014-07-22 7:53 ` Dan Carpenter
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=20140722075207.GN25880@mwanda \
--to=dan.carpenter@oracle.com \
--cc=andrey.krieger.utkin@gmail.com \
--cc=dcb314@hotmail.com \
--cc=jason.wessel@windriver.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kgdb-bugreport@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=wharms@bfs.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.