Re: [RFC PATCH 0/4] kstrdup optimization

From: Andi Kleen
Date: Tue Dec 30 2014 - 01:45:57 EST

Andrzej Hajda <a.hajda@xxxxxxxxxxx> writes:

> kstrdup if often used to duplicate strings where neither source neither
> destination will be ever modified. In such case we can just reuse the source
> instead of duplicating it. The problem is that we must be sure that
> the source is non-modifiable and its life-time is long enough.

What happens if someone is to kfree() these strings?


ak@xxxxxxxxxxxxxxx -- Speaking for myself only
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at