Mugilraj Dhavachelvan
2020-Oct-20 08:43 UTC
[Nouveau] [PATCH] x86/mm/kmmio: correctly handle kzalloc return
Replacing return value -1 to error code Signed-off-by: Mugilraj Dhavachelvan <dmugil2000 at gmail.com> --- arch/x86/mm/kmmio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c index be020a7bc414..15430520c232 100644 --- a/arch/x86/mm/kmmio.c +++ b/arch/x86/mm/kmmio.c @@ -386,7 +386,7 @@ static int add_kmmio_fault_page(unsigned long addr) f = kzalloc(sizeof(*f), GFP_ATOMIC); if (!f) - return -1; + return -ENOMEN; f->count = 1; f->addr = addr; -- 2.25.1
Pekka Paalanen
2020-Oct-20 09:34 UTC
[Nouveau] [PATCH] x86/mm/kmmio: correctly handle kzalloc return
On Tue, 20 Oct 2020 14:13:44 +0530 Mugilraj Dhavachelvan <dmugil2000 at gmail.com> wrote:> Replacing return value -1 to error code > > Signed-off-by: Mugilraj Dhavachelvan <dmugil2000 at gmail.com> > --- > arch/x86/mm/kmmio.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c > index be020a7bc414..15430520c232 100644 > --- a/arch/x86/mm/kmmio.c > +++ b/arch/x86/mm/kmmio.c > @@ -386,7 +386,7 @@ static int add_kmmio_fault_page(unsigned long addr) > > f = kzalloc(sizeof(*f), GFP_ATOMIC); > if (!f) > - return -1; > + return -ENOMEN; > > f->count = 1; > f->addr = addr;Hi, did you even build-test this? Why did you write this patch? What does it achieve? Thanks, pq -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: <https://lists.freedesktop.org/archives/nouveau/attachments/20201020/5b9eb1b6/attachment.sig>
Maybe Matching Threads
- [PATCH] x86/mm/kmmio: correctly handle kzalloc return
- [PATCH] x86/mm/kmmio: Fix returned errno code
- [PATCH 4.5 160/200] x86/mm/kmmio: Fix mmiotrace for hugepages
- [PATCH 4.4 137/163] x86/mm/kmmio: Fix mmiotrace for hugepages
- [added to the 4.1 stable tree] x86/mm/kmmio: Fix mmiotrace for hugepages