Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5210165pxj; Wed, 26 May 2021 05:35:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWfxNtSNe7m3NDlRxRiMATRJ8m4v67WLiZBodYetPE/97P8pmLLIaD1RZ6yCjCa7afs/eI X-Received: by 2002:a02:5b85:: with SMTP id g127mr3066637jab.80.1622032515473; Wed, 26 May 2021 05:35:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622032515; cv=none; d=google.com; s=arc-20160816; b=h1v1OLNNJFOUG6qz3sowbWoSXOpkFoBu0QNoC3EacGrFfLFboR8pbHEfcnZgEQC+m6 lPrmGlGqtVInEiMNpWt7lL9dxR9GhxqTnGNbXw/GnalFj/Hhh1FhCpyilbJHYj8jYQ1y lrI4oRz+fYi3cHoHf6JkjKvXGt6zktQSBaLDR6YGlOaOwlNx4HwNT7No0gJB6ib9g4/q GyWKBcoPowGS2q7+0Ctj9iCXVh3dC3vGyWeWr2T3NzVNmVLyDfJJTHwqOxe/RFvVRcvm 4SFsaJnhHPs6mvXHhLkDaahFkuA9+eFpJ53JFgBVpQeq26Oko4fJNvJ/YAB8dqVa9zqQ Hs9g== 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; bh=Zn2ffr8JYxoteRgfDN2DPfLGmOa7PHRalgcesR+84wk=; b=iKgQVMIOH0gGRG3e1EG1leGCOEe68dB5NdU0uFDAW+d93CVGBTW4EkIUtyEWvmSY3i AIzX/yEnKwpk136sFqZ8U+uxmzvXpPfFd6vgGU0Gc1DvqqR0E6N/k2uHAaxSoJI1yO7r 32ImWH5BGXbc7r+u5rg/wH4jZzdDFdrFlobPJb8K8Z0dfCXLBgmI5PZSjNiG69dxDER4 HowcLk6M2mKyK7F0kX3SYEL02SIjtqPkY7IY5TqR8NVpJaQtWxESaH5HXHYRYdnVaPH4 q0wwmOS8lM9t9m2kgZItYaImRC4beKuIqhvTDbRlQcQ9guZndOMGrx1qmWZKc2FTUy5S CYmg== ARC-Authentication-Results: i=1; mx.google.com; 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 b26si21217576jap.85.2021.05.26.05.35.01; Wed, 26 May 2021 05:35:15 -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; 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 S233770AbhEZKJH (ORCPT + 99 others); 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-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-kernel@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.