From mboxrd@z Thu Jan 1 00:00:00 1970 From: Saeed Mahameed Subject: Re: [net 3/6] net/mlx5: FPGA, return -EINVAL if size is zero Date: Fri, 10 Nov 2017 15:13:16 +0900 Message-ID: <1510294396.5405.11.camel@mellanox.com> References: <20171108072142.30870-1-saeedm@mellanox.com> <20171108072142.30870-4-saeedm@mellanox.com> <1510213411.16499.2.camel@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Linux Netdev List , David Miller , Yevgeny Kliteynik To: Or Gerlitz , Kamal Heib Return-path: Received: from mail-he1eur01on0050.outbound.protection.outlook.com ([104.47.0.50]:8224 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751226AbdKJGNv (ORCPT ); Fri, 10 Nov 2017 01:13:51 -0500 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Thu, 2017-11-09 at 18:12 +0900, Or Gerlitz wrote: > On Thu, Nov 9, 2017 at 4:43 PM, Kamal Heib > wrote: > > On Wed, 2017-11-08 at 23:13 +0900, Or Gerlitz wrote: > > > On Wed, Nov 8, 2017 at 4:21 PM, Saeed Mahameed > > om> > > > wrote: > > > > From: Kamal Heib > > > > > > > > In the current code, if a size of zero is passed to > > > > mlx5_fpga_mem_{read|write}_i2c() functions the "err" > > > > > > Don't we need to fix the call site where zero size is provided > > > and > > > not > > > in called function? > > > > > > > Isn't sending down a zero size a sign for a bug which we are not > > fixing? > > > > > > > Both functions are called from an exported symbols. so I think the > > size > > validation should be within this two functions just like the case > > of > > checking that mdev isn't set. > > mmm, I see exported to who exactly? how are they being called, by > func pointer? > can you point to the call sites? Or, are you ok with this patch ? I would like to post V2 with the reviewed-by tag fix.