From: Julia Lawall Date: Fri, 14 May 2010 19:30:30 +0000 (+0200) Subject: security/selinux/ss: Use kstrdup X-Git-Tag: v2.6.35-rc1~488^2^2~5 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3139bbc52762268769e7af842aade0e64372433;p=pandora-kernel.git security/selinux/ss: Use kstrdup Use kstrdup when the goal of an allocation is copy a string into the allocated region. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression from,to; expression flag,E1,E2; statement S; @@ - to = kmalloc(strlen(from) + 1,flag); + to = kstrdup(from, flag); ... when != \(from = E1 \| to = E1 \) if (to==NULL || ...) S ... when != \(from = E2 \| to = E2 \) - strcpy(to, from); // Signed-off-by: Julia Lawall Acked-by: Eric Paris Signed-off-by: James Morris --- Reading git-diff-tree failed