Commit 18b9fe54 authored by Sergey Shtylyov's avatar Sergey Shtylyov Committed by Andrew Morton
Browse files

powerpc: ptrace: user_regset_copyin_ignore() always returns 0

user_regset_copyin_ignore() always returns 0, so checking its result seems
pointless -- don't do this anymore...

[akpm@linux-foundation.org: fix gpr32_set_common()]
Link: https://lkml.kernel.org/r/20221014212235.10770-11-s.shtylyov@omp.ru


Signed-off-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
Cc: Brian Cain <bcain@quicinc.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: David S. Miller <davem@davemloft.net>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Helge Deller <deller@gmx.de>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Rich Felker <dalias@libc.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Will Deacon <will@kernel.org>
Cc: Yoshinori Sato <ysato@users.osdn.me>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent fa3ff3bf
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@ int tm_cgpr_set(struct task_struct *target, const struct user_regset *regset,
					 (PT_MAX_PUT_REG + 1) * sizeof(reg));

	if (PT_MAX_PUT_REG + 1 < PT_TRAP && !ret)
		ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
		user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
					  (PT_MAX_PUT_REG + 1) * sizeof(reg),
					  PT_TRAP * sizeof(reg));

@@ -183,7 +183,7 @@ int tm_cgpr_set(struct task_struct *target, const struct user_regset *regset,
	}

	if (!ret)
		ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
		user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
					  (PT_TRAP + 1) * sizeof(reg), -1);

	return ret;
+8 −7
Original line number Diff line number Diff line
@@ -267,7 +267,7 @@ static int gpr_set(struct task_struct *target, const struct user_regset *regset,
					 (PT_MAX_PUT_REG + 1) * sizeof(reg));

	if (PT_MAX_PUT_REG + 1 < PT_TRAP && !ret)
		ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
		user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
					  (PT_MAX_PUT_REG + 1) * sizeof(reg),
					  PT_TRAP * sizeof(reg));

@@ -280,7 +280,7 @@ static int gpr_set(struct task_struct *target, const struct user_regset *regset,
	}

	if (!ret)
		ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
		user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
					  (PT_TRAP + 1) * sizeof(reg), -1);

	return ret;
@@ -706,8 +706,9 @@ int gpr32_set_common(struct task_struct *target,
	ubuf = u;
	pos *= sizeof(reg);
	count *= sizeof(reg);
	return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
	user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
				  (PT_TRAP + 1) * sizeof(reg), -1);
	return 0;

Efault:
	user_read_access_end();