From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Date: Tue, 02 Apr 2019 19:55:37 +0000 Subject: Re: [PATCH] Bluetooth: hci_event: potential out of bounds parsing ADV events Message-Id: <20190402195537.GF32613@kadam> List-Id: References: <20190330072511.GA5502@kadam> <20190402063313.GA32613@kadam> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Cong Wang Cc: Tomas Bortoli , Marcel Holtmann , Jaganath Kanakkassery , Johan Hedberg , linux-bluetooth , kernel-janitors@vger.kernel.org On Tue, Apr 02, 2019 at 10:42:38AM -0700, Cong Wang wrote: > I think these likely()/unlikely() are reasonable, ill-formatted packets > are rare cases, normal packets deserve such a special care. We > use likely()/unlikely() with pskb_may_pull() in many places in > networking subsystem, at least. The likely()/unlikely() annotations are to help the compiler optimize the fast path. They are not there just for decorating the code. We should only use likely()/unlikely() where it makes a difference in benchmarking. Otherwise it's just a style question, right (obviously)? And it's better style to write things as simply as possible. regards, dan carpenter