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


Groups > linux.kernel > #1701316

Re: [PATCH 4.4 07/83] NFC: fix broken device allocation

From Ben Hutchings <ben.hutchings@codethink.co.uk>
Newsgroups linux.kernel
Subject Re: [PATCH 4.4 07/83] NFC: fix broken device allocation
Date 2017-08-01 20:20 +0200
Message-ID <u9JVT-7qE-15@gated-at.bofh.it> (permalink)
References <u7dGO-6Sz-33@gated-at.bofh.it> <u7fpg-86t-43@gated-at.bofh.it>
Organization Codethink Ltd.

Show all headers | View raw


On Tue, 2017-07-25 at 12:18 -0700, Greg Kroah-Hartman wrote:
> 4.4-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Johan Hovold <johan@kernel.org>
> 
> commit 20777bc57c346b6994f465e0d8261a7fbf213a09 upstream.
[...]
> --- a/net/nfc/core.c
> +++ b/net/nfc/core.c
[...]
> @@ -1077,6 +1089,11 @@ struct nfc_dev *nfc_allocate_device(stru
>  	}
>  
>  	return dev;
> +
> +err_free_dev:
> +	kfree(dev);
> +
> +	return ERR_PTR(rc);
>  }
>  EXPORT_SYMBOL(nfc_allocate_device);
[...]

But the callers expect a null pointer on error, not an error pointer.
This looks broken in mainline too.

Ben.

-- 
Ben Hutchings
Software Developer, Codethink Ltd.

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH 4.4 07/83] NFC: fix broken device allocation Ben Hutchings <ben.hutchings@codethink.co.uk> - 2017-08-01 20:20 +0200
  Re: [PATCH 4.4 07/83] NFC: fix broken device allocation Johan Hovold <johan@kernel.org> - 2017-08-01 21:20 +0200

csiph-web