summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2010-07-20 20:08:59 -0600
committerJens Axboe <jaxboe@fusionio.com>2010-08-07 18:52:31 +0200
commitad96a7a7ea950d5bc9755f2f568be185c7070f1e (patch)
treeec2d2c8e2d48c241e05d2acf6506a7105d3ed17c /scripts
parent6a32a8aed509e71137043d464db4a7fcd88c903e (diff)
downloadblackbird-op-linux-ad96a7a7ea950d5bc9755f2f568be185c7070f1e.tar.gz
blackbird-op-linux-ad96a7a7ea950d5bc9755f2f568be185c7070f1e.zip
drivers/block: use memdup_user
Use memdup_user when user data is immediately copied into the allocated region. Some checkpatch cleanups in nearby code. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression from,to,size,flag; position p; identifier l1,l2; @@ - to = \(kmalloc@p\|kzalloc@p\)(size,flag); + to = memdup_user(from,size); if ( - to==NULL + IS_ERR(to) || ...) { <+... when != goto l1; - -ENOMEM + PTR_ERR(to) ...+> } - if (copy_from_user(to, from, size) != 0) { - <+... when != goto l2; - -EFAULT - ...+> - } // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Cc: Chirag Kantharia <chirag.kantharia@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud