From patchwork Wed Feb 7 15:49:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 870450 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="E1K2mA8O"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zc5TC6yqbz9s71 for ; Thu, 8 Feb 2018 02:53:19 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id C4D391227; Wed, 7 Feb 2018 15:50:16 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 22C271225 for ; Wed, 7 Feb 2018 15:50:16 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.67]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 8032F3CC for ; Wed, 7 Feb 2018 15:50:15 +0000 (UTC) Received: by mail-pg0-f67.google.com with SMTP id w17so431078pgv.6 for ; Wed, 07 Feb 2018 07:50:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jnnmodkOQX0qwsZsAVAUiJ86cBNPBaN7dUJCbBCp3v8=; b=E1K2mA8OW7ECChu7VMSeAGvC+oh9KiTf4RFvAEvOrh9rkKi2ihjPyDoESMPInMmVZj CW+uxK7yEfBi9lt9Yxb4LP34PJG8VslYpAEDS7RnabJyeAIeuTPvDdlZSiXfxcDF2gGI akePHUfy0fB47uDJdvIgR+I0CzE+bEG57eD1Sygid3jcFSV2lznniU0MBuTsFZFQvzYE rOTWgGfCMkhSu1zeWQKkQMpI61cMW31FPvdoJ3xt1F/lVguRnaHzfldpNbAmkm/qswse mKWfe1AiR5lueM3gOOF+41tJHrv/sHXT/LNHPUJJFpHjafCoy4B3nTplxjQuAUQXd7BX cFWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jnnmodkOQX0qwsZsAVAUiJ86cBNPBaN7dUJCbBCp3v8=; b=Va/Qx/j4ZRKlbWFC4Gh6wQGTOs0u2FQC2ucgdXPusUb2IXmxaOmHkgeSuK8iLRV6AT y7dMAnSUD/z2a++iQjuZ5B2RYhxjdkvFZ7g/qTVTEJSZTiOVfznG7GBTCJ9g6ocL7okM Cp4tzEhB28JrIwwXFD5DJJ66x4A78QmzzOgYlvDjSPSnySIV8QBiFQgx0WFTbk6+47oV SkOLVekrjLGiXV+HkaJGEUanBeybEjCA3PwljvYmfGAxkc46XJJ5Pszk829htLg/PxiB 7s5wmc6k3A7FJEHCMe7xABrCc9nal/ZZ46fr3n6I/zH7bDtCafIni0Ujxi5AyiiFGhw3 QDLA== X-Gm-Message-State: APf1xPDTpaw5Qd1fyfkn+8c83ErccfzgcOdZEV1UAEtFOx4YHBgZQQTN GnREipa8ycTc3EO4np+uJtlTIg== X-Google-Smtp-Source: AH8x227EW/ui+TE5RB33Tzra4io3jKga968KURytEWfZXOK2QLsutd97oRd02R4PF2GCl1TjhTYv/Q== X-Received: by 10.98.236.156 with SMTP id e28mr6300556pfm.152.1518018614686; Wed, 07 Feb 2018 07:50:14 -0800 (PST) Received: from gizo.domain (184-100-240-187.ptld.qwest.net. [184.100.240.187]) by smtp.gmail.com with ESMTPSA id x15sm4924096pff.55.2018.02.07.07.50.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 07:50:12 -0800 (PST) From: Greg Rose To: dev@openvswitch.org Date: Wed, 7 Feb 2018 07:49:55 -0800 Message-Id: <1518018601-31980-6-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1518018601-31980-1-git-send-email-gvrose8192@gmail.com> References: <1518018601-31980-1-git-send-email-gvrose8192@gmail.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Wei Yongjun Subject: [ovs-dev] [PATCH v2 05/11] datapath: Fix return value check in ovs_meter_cmd_features() X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: Wei Yongjun Upstream commit: commit 8a860c2bcc84a8e4fbcabb928cd97e4c51b17d93 Author: Wei Yongjun Date: Tue Nov 14 06:20:16 2017 +0000 openvswitch: Fix return value check in ovs_meter_cmd_features() In case of error, the function ovs_meter_cmd_reply_start() returns ERR_PTR() not NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: 96fbc13d7e77 ("openvswitch: Add meter infrastructure") Signed-off-by: Wei Yongjun Acked-by: Pravin B Shelar Signed-off-by: David S. Miller Cc: Wei Yongjun Signed-off-by: Greg Rose --- datapath/meter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datapath/meter.c b/datapath/meter.c index 1ab965d..bc940ae 100644 --- a/datapath/meter.c +++ b/datapath/meter.c @@ -166,7 +166,7 @@ static int ovs_meter_cmd_features(struct sk_buff *skb, struct genl_info *info) reply = ovs_meter_cmd_reply_start(info, OVS_METER_CMD_FEATURES, &ovs_reply_header); - if (!reply) + if (IS_ERR(reply)) return PTR_ERR(reply); if (nla_put_u32(reply, OVS_METER_ATTR_MAX_METERS, U32_MAX) ||