Re: [PATCH 2/3] uprobes: change build_map_info() to trykmalloc(GFP_NOWAIT) first

From: Oleg Nesterov
Date: Tue Jun 05 2012 - 06:12:40 EST


On 06/04, Oleg Nesterov wrote:
>
> @@ -772,8 +772,13 @@ build_map_info(struct address_space *mapping, loff_t offset, bool is_register)
> continue;
>
> if (!prev) {
> - more++;
> - continue;
> + prev = kmalloc(sizeof(struct map_info),
> + GFP_NOWAIT | __GFP_NOMEMALLOC | __GFP_NOWARN);
> + if (!prev) {
> + more++;
> + continue;
> + }
> + prev->next = NULL;
> }

OK, this is not exactly right, it is pointless and wrong to
do kmalloc(GFP_NOWAIT) if it failed before (iow, more != 0).

Easy to fix, I'll send v2 tomorrow.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/