aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/qib/qib_fs.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-09-01 12:33:46 -0400
committerThomas Gleixner <tglx@linutronix.de>2016-09-01 12:33:46 -0400
commit0cb7bf61b1e9f05027de58c80f9b46a714d24e35 (patch)
tree41fb55cf62d07b425122f9a8b96412c0d8eb99c5 /drivers/infiniband/hw/qib/qib_fs.c
parentaa877175e7a9982233ed8f10cb4bfddd78d82741 (diff)
parent3eab887a55424fc2c27553b7bfe32330df83f7b8 (diff)
Merge branch 'linus' into smp/hotplug
Apply upstream changes to avoid conflicts with pending patches.
Diffstat (limited to 'drivers/infiniband/hw/qib/qib_fs.c')
-rw-r--r--drivers/infiniband/hw/qib/qib_fs.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/drivers/infiniband/hw/qib/qib_fs.c b/drivers/infiniband/hw/qib/qib_fs.c
index fcdf37913a26..c3edc033f7c4 100644
--- a/drivers/infiniband/hw/qib/qib_fs.c
+++ b/drivers/infiniband/hw/qib/qib_fs.c
@@ -328,26 +328,12 @@ static ssize_t flash_write(struct file *file, const char __user *buf,
328 328
329 pos = *ppos; 329 pos = *ppos;
330 330
331 if (pos != 0) { 331 if (pos != 0 || count != sizeof(struct qib_flash))
332 ret = -EINVAL; 332 return -EINVAL;
333 goto bail;
334 }
335
336 if (count != sizeof(struct qib_flash)) {
337 ret = -EINVAL;
338 goto bail;
339 }
340
341 tmp = kmalloc(count, GFP_KERNEL);
342 if (!tmp) {
343 ret = -ENOMEM;
344 goto bail;
345 }
346 333
347 if (copy_from_user(tmp, buf, count)) { 334 tmp = memdup_user(buf, count);
348 ret = -EFAULT; 335 if (IS_ERR(tmp))
349 goto bail_tmp; 336 return PTR_ERR(tmp);
350 }
351 337
352 dd = private2dd(file); 338 dd = private2dd(file);
353 if (qib_eeprom_write(dd, pos, tmp, count)) { 339 if (qib_eeprom_write(dd, pos, tmp, count)) {
@@ -361,8 +347,6 @@ static ssize_t flash_write(struct file *file, const char __user *buf,
361 347
362bail_tmp: 348bail_tmp:
363 kfree(tmp); 349 kfree(tmp);
364
365bail:
366 return ret; 350 return ret;
367} 351}
368 352