Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1700302

Re: [RFC v6 13/62] powerpc: track allocation status of all pkeys

From Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [RFC v6 13/62] powerpc: track allocation status of all pkeys
Date 2017-07-31 20:20 +0200
Message-ID <u9nsl-19s-3@gated-at.bofh.it> (permalink)
References <u3ISR-1St-3@gated-at.bofh.it> <u3Jcd-2ea-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Ram Pai <linuxram@us.ibm.com> writes:
>  static inline int mm_pkey_free(struct mm_struct *mm, int pkey)
>  {
> -	return -EINVAL;
> +	if (!pkey_inited)
> +		return -1;

Sorry, I missed this earlier but the pkey_free syscall will pass this
value to userspace so it needs to be an errno as well (-EINVAL?).

> +
> +	if (!mm_pkey_is_allocated(mm, pkey))
> +		return -EINVAL;
> +
> +	mm_set_pkey_free(mm, pkey);
> +
> +	return 0;
>  }

-- 
Thiago Jung Bauermann
IBM Linux Technology Center

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [RFC v6 13/62] powerpc: track allocation status of all pkeys Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> - 2017-07-31 20:20 +0200

csiph-web