[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <018c208a-9bcb-0c4c-7001-5447b06b1d84@amazon.com>
Date: Tue, 8 Jan 2019 12:25:56 +0200
From: Gal Pressman <galpress@...zon.com>
To: Aditya Pakki <pakki001@....edu>
CC: <kjlu@....edu>, Doug Ledford <dledford@...hat.com>,
Jason Gunthorpe <jgg@...pe.ca>,
Leon Romanovsky <leon@...nel.org>,
Parav Pandit <parav@...lanox.com>,
Dennis Dalessandro <dennis.dalessandro@...el.com>,
<linux-rdma@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] [v2]RDMA: add checks for the status of nla_put in
ib_nl_send_msg
On 05-Jan-19 19:09, Aditya Pakki wrote:
>
> static int ib_nl_get_path_rec_attrs_len(ib_sa_comp_mask comp_mask)
> @@ -856,7 +873,10 @@ static int ib_nl_send_msg(struct ib_sa_query *query, gfp_t gfp_mask)
> }
>
> /* Add attributes */
> - ib_nl_set_path_rec_attrs(skb, query);
> + if (ib_nl_set_path_rec_attrs(skb, query, nlh)) {
> + nlmsg_free(skb);
> + return -EMSGSIZE;
> + }
IMO, it's better to return the error code of ib_nl_set_path_rec_attrs instead of
an explicit -EMSGSIZE.
Powered by blists - more mailing lists