From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752459AbdIFT2v (ORCPT ); Wed, 6 Sep 2017 15:28:51 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:35699 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751457AbdIFT2r (ORCPT ); Wed, 6 Sep 2017 15:28:47 -0400 Date: Wed, 6 Sep 2017 22:28:21 +0300 From: Dan Carpenter To: Gilad Ben-Yossef Cc: Greg Kroah-Hartman , linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Ofir Drang Subject: Re: [PATCH 8/8] staging: ccree: remove BUG macro usage Message-ID: <20170906192821.4ytcxj436uyug6pr@mwanda> References: <1504429011-25514-1-git-send-email-gilad@benyossef.com> <1504429011-25514-9-git-send-email-gilad@benyossef.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1504429011-25514-9-git-send-email-gilad@benyossef.com> User-Agent: NeoMutt/20170113 (1.7.2) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 03, 2017 at 11:56:50AM +0300, Gilad Ben-Yossef wrote: > @@ -1154,7 +1150,8 @@ static inline int ssi_buffer_mgr_aead_chain_data( > //if have reached the end of the sgl, then this is unexpected > if (!areq_ctx->src_sgl) { > SSI_LOG_ERR("reached end of sg list. unexpected\n"); > - BUG(); > + return -EINVAL; > + goto chain_data_exit; You've got a direct return followed by a goto. It's a do-nothing goto that just returns rc. I hate those. I've tried to review locking bugs to see if single returns prevent future programmers from introducing new error paths which don't unlock. They don't really help... regards, dan carpenter