* [PATCH] libibmad/[register rpc].c: Fix some bounds checks
@ 2011-06-01 13:45 Hal Rosenstock
[not found] ` <4DE64295.6040908-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Hal Rosenstock @ 2011-06-01 13:45 UTC (permalink / raw)
To: Ira Weiny; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
diff --git a/src/register.c b/src/register.c
index 0ff8006..1fdb64a 100644
--- a/src/register.c
+++ b/src/register.c
@@ -77,7 +77,7 @@ static int mgmt_class_vers(int mgmt_class)
int mad_class_agent(int mgmt)
{
- if (mgmt < 1 || mgmt > MAX_CLASS)
+ if (mgmt < 1 || mgmt >= MAX_CLASS)
return -1;
return ibmp->class_agents[mgmt];
}
diff --git a/src/rpc.c b/src/rpc.c
index 88e43e7..d20c321 100644
--- a/src/rpc.c
+++ b/src/rpc.c
@@ -120,7 +120,7 @@ int mad_rpc_portid(struct ibmad_port *srcport)
int mad_rpc_class_agent(struct ibmad_port *port, int class)
{
- if (class < 1 || class > MAX_CLASS)
+ if (class < 1 || class >= MAX_CLASS)
return -1;
return port->class_agents[class];
}
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] libibmad/[register rpc].c: Fix some bounds checks
[not found] ` <4DE64295.6040908-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2011-06-01 21:54 ` Ira Weiny
0 siblings, 0 replies; 2+ messages in thread
From: Ira Weiny @ 2011-06-01 21:54 UTC (permalink / raw)
To: Hal Rosenstock; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On Wed, 1 Jun 2011 06:45:57 -0700
Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:
>
> Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Thanks, applied,
Ira
> ---
> diff --git a/src/register.c b/src/register.c
> index 0ff8006..1fdb64a 100644
> --- a/src/register.c
> +++ b/src/register.c
> @@ -77,7 +77,7 @@ static int mgmt_class_vers(int mgmt_class)
>
> int mad_class_agent(int mgmt)
> {
> - if (mgmt < 1 || mgmt > MAX_CLASS)
> + if (mgmt < 1 || mgmt >= MAX_CLASS)
> return -1;
> return ibmp->class_agents[mgmt];
> }
> diff --git a/src/rpc.c b/src/rpc.c
> index 88e43e7..d20c321 100644
> --- a/src/rpc.c
> +++ b/src/rpc.c
> @@ -120,7 +120,7 @@ int mad_rpc_portid(struct ibmad_port *srcport)
>
> int mad_rpc_class_agent(struct ibmad_port *port, int class)
> {
> - if (class < 1 || class > MAX_CLASS)
> + if (class < 1 || class >= MAX_CLASS)
> return -1;
> return port->class_agents[class];
> }
--
Ira Weiny
Math Programmer/Computer Scientist
Lawrence Livermore National Lab
925-423-8008
weiny2-i2BcT+NCU+M@public.gmane.org
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-01 21:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-01 13:45 [PATCH] libibmad/[register rpc].c: Fix some bounds checks Hal Rosenstock
[not found] ` <4DE64295.6040908-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2011-06-01 21:54 ` Ira Weiny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox