From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 237F2C2B9F7 for ; Wed, 26 May 2021 10:07:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EFA2561442 for ; Wed, 26 May 2021 10:07:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233783AbhEZKJH (ORCPT ); Wed, 26 May 2021 06:09:07 -0400 Received: from mail-wm1-f47.google.com ([209.85.128.47]:37608 "EHLO mail-wm1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233767AbhEZKJF (ORCPT ); Wed, 26 May 2021 06:09:05 -0400 Received: by mail-wm1-f47.google.com with SMTP id f20-20020a05600c4e94b0290181f6edda88so141185wmq.2; Wed, 26 May 2021 03:07:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Zn2ffr8JYxoteRgfDN2DPfLGmOa7PHRalgcesR+84wk=; b=FBQswfXEvhcIPu6qtq1G30fehiRhU7qTR7FioWQKRPcItSITZlXr9VmE9StIWrL1uY XA35HflYt3m/Un4l1hJ/gyqpLYVUvPxENyTRph0T71Ok2tP4+i6s4g6Lzrf79uyZ2vQn 1QGPAHk7HfSHqvktCTN/WRrGZwEvTJmhagbWOgomxEU9Ga9nKgdAo11qVNcIIjN7e4UA y+/fRlm//yV072iHGa7Z7QlZKue/uReT2DTe6sOMHkQmNSnNqZRhrUO+l9QSrx/vu1FS q9F0lVuvh39Fg9hIBUCNoUPiZ+ZwXIQXw6L7e8Xij4FFADk5M1AMu7EfOuk0aCGArRj/ StPg== X-Gm-Message-State: AOAM530GIoujEw1CaE4BB2tu9O1B8xQo0umP+VVF5QCVn/UOI8cJnjY1 WxjcAv0q/r51oTfx+akdHlM= X-Google-Smtp-Source: ABdhPJxPaM7KVevhYV2qeLsfVfVCCezJ/Fd6bhCABfmcYvL1i91n62q4G0bpOukUTdpNvhpJMehZTQ== X-Received: by 2002:a05:600c:1551:: with SMTP id f17mr2489743wmg.17.1622023653000; Wed, 26 May 2021 03:07:33 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id v3sm19745861wrr.19.2021.05.26.03.07.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 03:07:32 -0700 (PDT) Date: Wed, 26 May 2021 10:07:30 +0000 From: Wei Liu To: Michael Kelley Cc: Jiapeng Chong , KY Srinivasan , Haiyang Zhang , Stephen Hemminger , "wei.liu@kernel.org" , Dexuan Cui , "linux-hyperv@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] drivers: hv: Fix missing error code in vmbus_connect() Message-ID: <20210526100730.fsk3khdqmpbbuljf@liuwe-devbox-debian-v2> References: <1621940321-72353-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: Precedence: bulk List-ID: X-Mailing-List: linux-hyperv@vger.kernel.org On Tue, May 25, 2021 at 03:30:22PM +0000, Michael Kelley wrote: > From: Jiapeng Chong Sent: Tuesday, May 25, 2021 3:59 AM > > > > Eliminate the follow smatch warning: > > > > drivers/hv/connection.c:236 vmbus_connect() warn: missing error code > > 'ret'. > > > > Reported-by: Abaci Robot > > Signed-off-by: Jiapeng Chong > > --- > > drivers/hv/connection.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c > > index 311cd00..5e479d5 100644 > > --- a/drivers/hv/connection.c > > +++ b/drivers/hv/connection.c > > @@ -232,8 +232,10 @@ int vmbus_connect(void) > > */ > > > > for (i = 0; ; i++) { > > - if (i == ARRAY_SIZE(vmbus_versions)) > > + if (i == ARRAY_SIZE(vmbus_versions)) { > > + ret = -EDOM; > > goto cleanup; > > + } > > > > version = vmbus_versions[i]; > > if (version > max_version) > > -- > > 1.8.3.1 > > I might have used -EINVAL instead of -EDOM as the error > return value, but it really doesn't matter, and having a > return value that is unique in the function might be helpful. > > Reviewed-by: Michael Kelley Applied to hyperv-fixes. Thanks.