Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2070180pxb; Mon, 8 Mar 2021 13:18:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJypZlHXhhWe0RlVCY/DYlBMAIufm9tH7yJ00QOqFloMFT9VmTuO9LkXYQ8nqw366l0lPddR X-Received: by 2002:a17:906:f8d5:: with SMTP id lh21mr16784434ejb.64.1615238332280; Mon, 08 Mar 2021 13:18:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615238332; cv=none; d=google.com; s=arc-20160816; b=yKrP7yKbBikmF+eFgWmki2qmWh6gLPMEZT+A2Ck8NnPk6+ei9dl9y5bU5uMIYmzT0C cyy8y3paZriTDJg/7/WSxdgmaaX6qWE/daUPlPQkdG5Lz3ZS7dmEUKrXtbBdBBag5AUX iFknooqW/5GJ1mAiIjUqQ53dY/DYT0EIMMhSbkUaWg9TDQP26xQK00NHOvYW2m5bjjOM UD3qn6W9QCvnGJDjggybTzNf2kZkaUHyS/0tgEpxoZ4qiZv1qJYyMmKcUpjEbyitkP6+ UvFPDRsELrziaM4xqJbDRnQYOIrlOKczjHrmRyHgrtAxOw0+jdMFmbXdmTOLecogVuav s2zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=bK1egWRIYmAM57JGkevuvF9LMdJfxUITtPUiQtDDxH8=; b=ty19DfChgQptsxiTefVDqFy1UDtuSRTSA/iE4rvB9j2WGaiRwstsMduQPFsWJ2zM2F bZAxTgomP4AZFqXKDZNcZsl/Omoa2PMdisSLmrMZDYsf0VIoWpUFbPOjJOE4GLg+CbHN acPb7s5+d7WZxtaHP2WrdtZuGkfzS52Q0K6UqsBQR+LZFlxMJ1ZdhG3yuaw4FABW7UK9 1L7NDjwhcQuxBO2jVkrXwv0MqH8c/cW2/cvRO3xaclPm5A+sy90iPAWsGP5Ra+0zA2p2 34azATdEzff8/DiBG6jlUFeaiCD3PLMVBp4Zl268qtXFhu0UhdBTVxbaUMJ1KYE73iCF kHFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EenPaZb8; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q17si6826863eju.412.2021.03.08.13.18.29; Mon, 08 Mar 2021 13:18:52 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=EenPaZb8; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229637AbhCHVPb (ORCPT + 99 others); Mon, 8 Mar 2021 16:15:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229901AbhCHVPF (ORCPT ); Mon, 8 Mar 2021 16:15:05 -0500 Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FC60C06174A for ; Mon, 8 Mar 2021 13:15:05 -0800 (PST) Received: by mail-oi1-x232.google.com with SMTP id d20so12516279oiw.10 for ; Mon, 08 Mar 2021 13:15:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=bK1egWRIYmAM57JGkevuvF9LMdJfxUITtPUiQtDDxH8=; b=EenPaZb8C5Pijx6LJUC0kSF/ossy/pi8y6ZPOsNrLIEGnRwr+gDjWinvE/IfeHPl0B Kwqh/gBucHSUJfPse7F9QsHL5OVGBnSGQKBvNrth5IPfVHFNyAmfGDaYvPsFCY8eKkYv 25ug1JFNnNqDwSqXhPd0HUU13YhGyUgxMOVAT1MU7U4Z+1YfDTV3KW3E1ViLyLdhUkBV SAD5oPTvLGBS5fHJQG28JKAG4kv/V74CAvHXT4uTHKMVl7klbfdMvgelxr1ug53dP26X 6F0sQtG4CBIVgJMwx5RxRaIkQXs4YjFcBFuQUz/WOVlptAMzm6R85WPpyqUIMnBigfch JLWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=bK1egWRIYmAM57JGkevuvF9LMdJfxUITtPUiQtDDxH8=; b=a0w8mE8r8yE0N9/MzC/KTx8XcUVlJ5WBYStslJY993aszfXK/soXU9F+bh7esqWHH4 L8qGLD3G9EO6YSYadHgiEzWYy5+96maCGmzFkmVi5KS+4Z4oq8VZzH6w0FwcJnqrGLGE gAAASfFG7uWKgy6cOuOsT7KxohPvEMSkqxM7fnzam+8/GndwKaZkdBKCCVnn0eydegZG U+24a8KEtgcVgUPjcX/EkeYvqyM/lkBpVDLc935xuvwMJWYE1p3BodoNUAle09Zr0Snl dsYLqIriQnUSFhCl5nA2/TmL/Ae73KWL9PhMyNYzNEoGZoJeXrXyC/X3Z8VelReEvMtv eDhA== X-Gm-Message-State: AOAM532khsgvbZkjKDnG6fu3ArKhS+yA2EbOKhOenRAbYi+b00YOCsMp I8HJFrAp/IN3aZYemb28DP9ITpWyufBxgl9Up8o= X-Received: by 2002:a05:6808:f15:: with SMTP id m21mr606723oiw.123.1615238104977; Mon, 08 Mar 2021 13:15:04 -0800 (PST) MIME-Version: 1.0 References: <20210305035428.6750-1-baijiaju1990@gmail.com> In-Reply-To: From: Alex Deucher Date: Mon, 8 Mar 2021 16:14:53 -0500 Message-ID: Subject: Re: [PATCH] gpu: drm: swsmu: fix error return code of smu_v11_0_set_allowed_mask() To: "Quan, Evan" Cc: Jia-Ju Bai , "Deucher, Alexander" , "Koenig, Christian" , "airlied@linux.ie" , "daniel@ffwll.ch" , "Zhang, Hawking" , "Wang, Kevin(Yang)" , "Gao, Likun" , "dri-devel@lists.freedesktop.org" , "amd-gfx@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Applied. Thanks! Alex On Thu, Mar 4, 2021 at 11:02 PM Quan, Evan wrote: > > [AMD Public Use] > > Thanks. Reviewed-by: Evan Quan > > -----Original Message----- > From: Jia-Ju Bai > Sent: Friday, March 5, 2021 11:54 AM > To: Deucher, Alexander ; Koenig, Christian ; airlied@linux.ie; daniel@ffwll.ch; Quan, Evan ; Zhang, Hawking ; Wang, Kevin(Yang) = ; Gao, Likun > Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux= -kernel@vger.kernel.org; Jia-Ju Bai > Subject: [PATCH] gpu: drm: swsmu: fix error return code of smu_v11_0_set_= allowed_mask() > > When bitmap_empty() or feature->feature_num triggers an error, no error r= eturn code of smu_v11_0_set_allowed_mask() is assigned. > To fix this bug, ret is assigned with -EINVAL as error return code. > > Reported-by: TOTE Robot > Signed-off-by: Jia-Ju Bai > --- > drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c b/drivers/gpu= /drm/amd/pm/swsmu/smu11/smu_v11_0.c > index 90585461a56e..82731a932308 100644 > --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c > +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c > @@ -747,8 +747,10 @@ int smu_v11_0_set_allowed_mask(struct smu_context *s= mu) > int ret =3D 0; > uint32_t feature_mask[2]; > > - if (bitmap_empty(feature->allowed, SMU_FEATURE_MAX) || feature->f= eature_num < 64) > + if (bitmap_empty(feature->allowed, SMU_FEATURE_MAX) || feature->f= eature_num < 64) { > + ret =3D -EINVAL; > goto failed; > + } > > bitmap_copy((unsigned long *)feature_mask, feature->allowed, 64); > > -- > 2.17.1 > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel