mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
kernel: trace: blktrace: remove redundent memcpy() in compat_blk_trace_setup()
do_blk_trace_setup() will fully initialize 'buts.name', so can remove the related memcpy(). And also use BLKTRACE_BDEV_SIZE and ARRAY_SIZE instead of hard code number '32'. Signed-off-by: Chen Gang <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
6678d83f18
commit
f8c5e94486
2 changed files with 2 additions and 3 deletions
|
|
@ -579,13 +579,12 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
|
|||
.end_lba = cbuts.end_lba,
|
||||
.pid = cbuts.pid,
|
||||
};
|
||||
memcpy(&buts.name, &cbuts.name, 32);
|
||||
|
||||
ret = do_blk_trace_setup(q, name, dev, bdev, &buts);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (copy_to_user(arg, &buts.name, 32)) {
|
||||
if (copy_to_user(arg, &buts.name, ARRAY_SIZE(buts.name))) {
|
||||
blk_trace_remove(q);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue