lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7a2028c6-8ed6-1fc4-3abf-b13f7254cdee@linux.intel.com>
Date:   Mon, 20 Jun 2022 11:18:53 +0100
From:   Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>
To:     zys.zljxml@...il.com, dri-devel@...ts.freedesktop.org,
        intel-gfx@...ts.freedesktop.org, jani.nikula@...ux.intel.com,
        joonas.lahtinen@...ux.intel.com, rodrigo.vivi@...el.com,
        airlied@...ux.ie, daniel@...ll.ch
Cc:     bob.beckett@...labora.com, matthew.auld@...el.com,
        thomas.hellstrom@...ux.intel.com, kernel@...labora.com,
        linux-kernel@...r.kernel.org, katrinzhou <katrinzhou@...cent.com>
Subject: Re: [PATCH] drm/i915/gem: remove unused assignments


On 20/06/2022 11:02, zys.zljxml@...il.com wrote:
> From: katrinzhou <katrinzhou@...cent.com>
> 
> The variable ret is reassigned and the value EINVAL is never used.
> Thus, remove the unused assignments.
> 
> Addresses-Coverity: ("Unused value")
> Fixes: d4433c7600f7 ("drm/i915/gem: Use the proto-context to handle create parameters (v5)")
> Signed-off-by: katrinzhou <katrinzhou@...cent.com>
> ---
>   drivers/gpu/drm/i915/gem/i915_gem_context.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> index ab4c5ab28e4d..d5ef5243673a 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> @@ -931,8 +931,6 @@ static int set_proto_ctx_param(struct drm_i915_file_private *fpriv,
>   		break;
>   
>   	case I915_CONTEXT_PARAM_PERSISTENCE:
> -		if (args->size)
> -			ret = -EINVAL;
>   		ret = proto_context_set_persistence(fpriv->dev_priv, pc,
>   						    args->value);

AFAICT fix should end up with code like this:

if (args->size)
	ret = -EINVAL;
else
	ret = proto_context_set_persistence(...)
break;


Alternatively move args->size checking into 
proto_context_set_persistence to align with set_persistence().

Regards,

Tvrtko

>   		break;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ