* [PATCH] IB/srpt: Suppress a compiler warning
@ 2015-03-30 10:37 Bart Van Assche
[not found] ` <5519275F.6070102-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Bart Van Assche @ 2015-03-30 10:37 UTC (permalink / raw)
To: Roland Dreier
Cc: Nicholas A. Bellinger, Sagi Grimberg, linux-rdma, David Binderman
Remove a BUG_ON(!ch) statement because it is superfluous - if
the ch pointer would be NULL then the assignment in the first
line of srpt_map_sg_to_ib_sge() would trigger a kernel oops anyway.
This patch suppresses the following compiler warning:
Possible null pointer dereference: ch - otherwise it is redundant to
check it against null.
Reported-by: David Binderman <dcb314-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
---
drivers/infiniband/ulp/srpt/ib_srpt.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c
b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 6e0a477..4e74fc8 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -1095,7 +1095,6 @@ static int srpt_map_sg_to_ib_sge(struct
srpt_rdma_ch *ch,
int count, nrdma;
int i, j, k;
- BUG_ON(!ch);
BUG_ON(!ioctx);
cmd = &ioctx->cmd;
dir = cmd->data_direction;
--
2.1.4
--
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] IB/srpt: Suppress a compiler warning
[not found] ` <5519275F.6070102-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
@ 2015-03-30 13:22 ` Sagi Grimberg
0 siblings, 0 replies; 2+ messages in thread
From: Sagi Grimberg @ 2015-03-30 13:22 UTC (permalink / raw)
To: Bart Van Assche, Roland Dreier
Cc: Nicholas A. Bellinger, Sagi Grimberg, linux-rdma, David Binderman
On 3/30/2015 1:37 PM, Bart Van Assche wrote:
> Remove a BUG_ON(!ch) statement because it is superfluous - if
> the ch pointer would be NULL then the assignment in the first
> line of srpt_map_sg_to_ib_sge() would trigger a kernel oops anyway.
>
> This patch suppresses the following compiler warning:
>
> Possible null pointer dereference: ch - otherwise it is redundant to
> check it against null.
>
> Reported-by: David Binderman <dcb314-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
> Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
> ---
> drivers/infiniband/ulp/srpt/ib_srpt.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c
> b/drivers/infiniband/ulp/srpt/ib_srpt.c
> index 6e0a477..4e74fc8 100644
> --- a/drivers/infiniband/ulp/srpt/ib_srpt.c
> +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
> @@ -1095,7 +1095,6 @@ static int srpt_map_sg_to_ib_sge(struct
> srpt_rdma_ch *ch,
> int count, nrdma;
> int i, j, k;
>
> - BUG_ON(!ch);
> BUG_ON(!ioctx);
> cmd = &ioctx->cmd;
> dir = cmd->data_direction;
>
Acked-by: Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@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:[~2015-03-30 13:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-30 10:37 [PATCH] IB/srpt: Suppress a compiler warning Bart Van Assche
[not found] ` <5519275F.6070102-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2015-03-30 13:22 ` Sagi Grimberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox