Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp339512pxf; Thu, 18 Mar 2021 01:16:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3TtQaejGskCPuNSBb56JUP5zXETwF8ZDERMU0ghop2J9wO5ewO3n4OJYXTM2T4vx1jcrz X-Received: by 2002:a17:906:14d4:: with SMTP id y20mr39935810ejc.190.1616055388513; Thu, 18 Mar 2021 01:16:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616055388; cv=none; d=google.com; s=arc-20160816; b=OF/EHLHytnReXOHPWeLkfiSdaxxP/AcxQKAJlBQxGxHz6Bg0pwh5cHCJk9hfnyYUlw ArIgeK8Cywi1qBsUGcvPZr1jvlOgK4SOVFjM+HxzOWNwMEzExNeRO/s8Qofp1dJyymmG 0HUnXf2enbnamc+wZ+9L3eR3TB2x/r7wuYZwUAu3mpBDL2gA+JBUH85zjabab0aEPHwD FzUt02mJifTta8SPxsxMqqVVhz+JcOeEquECXYJxvlVMfXMrsVF700Ub5eJZnlS3msYl 0nwrZt5LyglCwIdq3PubmP9EDPM8Oi8rJe5TdfWSX8+Q6x8dpdqhSkP8ZeNpE2uRJvk+ mimQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tbpw178V5uh1MyYlyxt8gHCCnMspgpuwVT1P9W8MnCQ=; b=mmOnZRbQntwisA16jDt5pBxa6HEa9NYmgBCvxMJrCXEDPeR3PH8Ptw7pxiE9FZn9Am 4KjMIaiDRLrMv/MesxD0sgHC0VbQ+C7IItTZTtE9zBD3G3ZsKh2T4vkNpQdFzhdXep4z TVXXNGf4ZBJT1rat+voJUtdtHo4HUYUJwURi5TgBgWroQXD32Vyf8G3XeYkPPbikqAiC aD+itywz9r9kQ3fltC7/GlN8h1roM54HAtUxEgdc4HEOc33VHHicE0w8GLMG36ukzMc+ ytRpgKJdCGrjQZ7ZXOw/poMSebyhkXx5X+9x/txHSIi3LS86pIWpPL1xBpTl89MY54Wo vdxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VXVJYN7X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lu7si1134330ejb.27.2021.03.18.01.16.05; Thu, 18 Mar 2021 01:16:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VXVJYN7X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229618AbhCRIOw (ORCPT + 99 others); Thu, 18 Mar 2021 04:14:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:48728 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbhCRIOY (ORCPT ); Thu, 18 Mar 2021 04:14:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B151664F04; Thu, 18 Mar 2021 08:14:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616055264; bh=lIluJSl7BAktteo3lXWTWv4jITCh1L+JcnjAe33GBvQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VXVJYN7XGEb23i1vob61kUo8podqJ+4SGupEUnRJB6eZhyMjEb/JtTaR3LNlbZftJ CHU0v0wMYugkmM5ikIO2B9GvGPSd3mLiS+bA5BxQY8CWPhelil1wwZw0hBhtwgGxAF 2ST6IJVZknpSiApaG62QZIWghoJ9ySg3R95h4xx816YT2AMluzzsU33KT/b8LuGdCC P85zdILFeRJJfNCgyIh18lVZhGcUJL/k6G/Lm4RI48VrnC4wW7wTbwOpgRBHkKqM/f 7HLtzIwfndtkjYlz6Q+EDGvpymgQh9HJ3g+X8axx5usQh6gBraHYPuiS2Lw6grICwn dsAjw7J8lMrLg== Date: Thu, 18 Mar 2021 10:14:20 +0200 From: Leon Romanovsky To: Jiapeng Chong Cc: dhowells@redhat.com, davem@davemloft.net, kuba@kernel.org, linux-afs@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rxrpc: rxkad: replace if (cond) BUG() with BUG_ON() Message-ID: References: <1615952318-4861-1-git-send-email-jiapeng.chong@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1615952318-4861-1-git-send-email-jiapeng.chong@linux.alibaba.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 17, 2021 at 11:38:38AM +0800, Jiapeng Chong wrote: > Fix the following coccicheck warnings: > > ./net/rxrpc/rxkad.c:1140:2-5: WARNING: Use BUG_ON instead of if > condition followed by BUG. > > Reported-by: Abaci Robot > Signed-off-by: Jiapeng Chong > --- > net/rxrpc/rxkad.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c > index e2e9e9b..bfa3d9a 100644 > --- a/net/rxrpc/rxkad.c > +++ b/net/rxrpc/rxkad.c > @@ -1135,9 +1135,8 @@ static void rxkad_decrypt_response(struct rxrpc_connection *conn, > ntohl(session_key->n[0]), ntohl(session_key->n[1])); > > mutex_lock(&rxkad_ci_mutex); > - if (crypto_sync_skcipher_setkey(rxkad_ci, session_key->x, > - sizeof(*session_key)) < 0) > - BUG(); > + BUG_ON(crypto_sync_skcipher_setkey(rxkad_ci, session_key->x, > + sizeof(*session_key)) < 0); It will be better to delete this BUG_ON() or find a way to ensure that it doesn't happen and delete after that. Thanks > > memcpy(&iv, session_key, sizeof(iv)); > > -- > 1.8.3.1 >