Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp288443ybc; Fri, 15 Nov 2019 22:47:15 -0800 (PST) X-Google-Smtp-Source: APXvYqx3iPw7A5KelHiaTpZ5BxfJnQgdN9nohFiLSL7QFJacH4xiSrPHomx+Xo5IcQkl1Oqv+8YA X-Received: by 2002:a17:906:1d01:: with SMTP id n1mr7241538ejh.95.1573886835495; Fri, 15 Nov 2019 22:47:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573886835; cv=none; d=google.com; s=arc-20160816; b=g2aeNeDsLRZfmoZJ8sdTECrJhWsiplZPv1hsLt5cyWh0oJdSqj23Z3YrzCkhpziJp/ HV3obw+W9G60w53LxF5VQ1IP9RMcUurby9XPEWE7VBWApmbA6bKhgrFmPqPEax6cFaNG DjsIHF/UDYC+TV4g7PENAzMy3nwq48puNDKvZ1E3H/Yp/v2XVbGtCqS+s9rt9scQB2Bv X3PJAHbt1xme7RnTs/7AHSpP+SE3Sl/4KGHBvlumhVKyqiD+idSy5tI1+x0Px2IF/LVh UGJVdty7XYteZBOodehVKCpux9Lg3VvO4V/yzomG0OdD6Vqwop8+4asMGeWEC2fLLc4+ g7wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=D82Q5we/zjUJ4abfuR933YYM6jEU45+Z+GBcQ6Tocnc=; b=e3SbFlOztGDDnWtZIanlNzz+rGHuFbqufQOP5k8w97KDrz/TzRhZHPfcUf9YBk1ffo HLExMb0cG2h+7YXvItH9WSfgDrQ+QXKzEirVxHv5h8eEvY1v8m5AfCZgAkzHy7eRWH4l fM6NVmZ2bje/42AhYQ1WgFCad4iYJ7YCAag6K5I8/A78dIP5Yvh1sTZ93dmXomqJFM+P rxfUCtAa2MeWFrLrbMaVPN5Uk/zKzjZJH1gS2vFL3LdcYNpYmGWE1QQvN+pJvHYLHVnP b85c+h81JPSt6n4ES0GRHMN+SqM5bsrYVASr2eySgfh/zH1tNjt2s/+Iw89cEU8TXUzx Blsg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b29si8955073ede.118.2019.11.15.22.46.50; Fri, 15 Nov 2019 22:47:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726679AbfKPGoX (ORCPT + 99 others); Sat, 16 Nov 2019 01:44:23 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:60154 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726154AbfKPGoW (ORCPT ); Sat, 16 Nov 2019 01:44:22 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 98ECDBF089C18B1D5264; Sat, 16 Nov 2019 14:44:18 +0800 (CST) Received: from localhost.localdomain (10.90.53.225) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.439.0; Sat, 16 Nov 2019 14:44:09 +0800 From: Chen Wandun To: , , , CC: Subject: [PATCH] crypto: essiv: remove redundant null pointer check before kfree Date: Sat, 16 Nov 2019 14:51:00 +0800 Message-ID: <1573887060-100725-1-git-send-email-chenwandun@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kfree has taken null pointer check into account. so it is safe to remove the unnecessary check. Signed-off-by: Chen Wandun --- crypto/essiv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crypto/essiv.c b/crypto/essiv.c index efea5af..75d810d 100644 --- a/crypto/essiv.c +++ b/crypto/essiv.c @@ -188,8 +188,7 @@ static void essiv_aead_done(struct crypto_async_request *areq, int err) struct aead_request *req = areq->data; struct essiv_aead_request_ctx *rctx = aead_request_ctx(req); - if (rctx->assoc) - kfree(rctx->assoc); + kfree(rctx->assoc); aead_request_complete(req, err); } -- 2.7.4