All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: IB/iser: Generalize rdma memory registration
Date: Thu, 15 Aug 2013 11:45:00 +0300	[thread overview]
Message-ID: <520C950C.4060507@mellanox.com> (raw)
In-Reply-To: <20130814195201.GB16390-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>

On 8/14/2013 10:52 PM, Dan Carpenter wrote:
> Hello Sagi Grimberg,
>
> This is a semi-automatic email about new static checker warnings.
>
> The patch b4e155ffbbd6: "IB/iser: Generalize rdma memory
> registration" from Jul 28, 2013, leads to the following Smatch
> complaint:
>
> drivers/infiniband/ulp/iser/iser_initiator.c:318 iser_free_rx_descriptors()
> 	 error: we previously assumed 'device' could be null (see line 313)
>
> drivers/infiniband/ulp/iser/iser_initiator.c
>     312	
>     313		if (device && device->iser_free_rdma_reg_res)
>                      ^^^^^^
> New check.
>
>     314			device->iser_free_rdma_reg_res(ib_conn);
>     315	
>     316		rx_desc = ib_conn->rx_descs;
>     317		for (i = 0; i < ib_conn->qp_max_recv_dtos; i++, rx_desc++)
>     318			ib_dma_unmap_single(device->ib_device, rx_desc->dma_addr,
>                                              ^^^^^^^^^^^^^^^^^
> Old dererference.
>
>     319					    ISER_RX_PAYLOAD_SIZE, DMA_FROM_DEVICE);
>     320		kfree(ib_conn->rx_descs);
>
> Has the code changed so that we need to check now?
>
> regards,
> dan carpenter

Hey Dan,

Thanks for the input!
The case here is that for some weird error flows we can end-up in this 
function with device == NULL, but if you pass the first condition if 
(!ib_conn->rx_descs) you are safe...

I'll fire up a fix for that asap.

Cheers,

-Sagi
--
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

      parent reply	other threads:[~2013-08-15  8:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-14 19:52 IB/iser: Generalize rdma memory registration Dan Carpenter
     [not found] ` <20130814195201.GB16390-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
2013-08-15  8:45   ` Sagi Grimberg [this message]

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=520C950C.4060507@mellanox.com \
    --to=sagig-vpraknaxozvwk0htik3j/w@public.gmane.org \
    --cc=dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 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.