)]}'
{
  "commit": "df1f1d1cb43b4ffdef5ba5f0623e2f73e94ce030",
  "tree": "fdef68b0b5230b9f49f7b26eee33aee4e4f042e3",
  "parents": [
    "39c5837d7968ffd68e1d3c79efba1631b7f513d9"
  ],
  "author": {
    "name": "Julia Lawall",
    "email": "julia@diku.dk",
    "time": "Sat May 22 10:22:49 2010 +0200"
  },
  "committer": {
    "name": "David Woodhouse",
    "email": "David.Woodhouse@intel.com",
    "time": "Sat May 22 11:49:37 2010 +0100"
  },
  "message": "drivers/mtd: Use memdup_user\n\nUse memdup_user when user data is immediately copied into the\nallocated region.\n\nThe semantic patch that makes this change is as follows:\n(http://coccinelle.lip6.fr/)\n\n// \u003csmpl\u003e\n@@\nexpression from,to,size,flag;\nposition p;\nidentifier l1,l2;\n@@\n\n-  to \u003d \\(kmalloc@p\\|kzalloc@p\\)(size,flag);\n+  to \u003d memdup_user(from,size);\n   if (\n-      to\u003d\u003dNULL\n+      IS_ERR(to)\n                 || ...) {\n   \u003c+... when !\u003d goto l1;\n-  -ENOMEM\n+  PTR_ERR(to)\n   ...+\u003e\n   }\n-  if (copy_from_user(to, from, size) !\u003d 0) {\n-    \u003c+... when !\u003d goto l2;\n-    -EFAULT\n-    ...+\u003e\n-  }\n// \u003c/smpl\u003e\n\nSigned-off-by: Julia Lawall \u003cjulia@diku.dk\u003e\nSigned-off-by: David Woodhouse \u003cDavid.Woodhouse@intel.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8bb5e4a663284b5e0fbbf1e617ec80813d3d71c9",
      "old_mode": 33188,
      "old_path": "drivers/mtd/mtdchar.c",
      "new_id": "8b223c0343eee1844719282ac1d8a1f36423e779",
      "new_mode": 33188,
      "new_path": "drivers/mtd/mtdchar.c"
    }
  ]
}
