Skip to content

Commit c9cc8ae

Browse files
ameryhungKernel Patches Daemon
authored andcommitted
rqspinlock: Handle return of raw_res_spin_lock{_irqsave} in locktorture
Return errors from raw_res_spin_lock{_irqsave}() to writelock(). This is simply to silence the unused result warning. lock_torture_writer() currently does not handle errors returned from writelock(). This aligns with the existing torture test for ww_mutex. Signed-off-by: Amery Hung <ameryhung@gmail.com>
1 parent 535ce04 commit c9cc8ae

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

kernel/locking/locktorture.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,7 @@ static rqspinlock_t rqspinlock;
369369

370370
static int torture_raw_res_spin_write_lock(int tid __maybe_unused)
371371
{
372-
raw_res_spin_lock(&rqspinlock);
373-
return 0;
372+
return raw_res_spin_lock(&rqspinlock);
374373
}
375374

376375
static void torture_raw_res_spin_write_unlock(int tid __maybe_unused)
@@ -392,8 +391,12 @@ static struct lock_torture_ops raw_res_spin_lock_ops = {
392391
static int torture_raw_res_spin_write_lock_irq(int tid __maybe_unused)
393392
{
394393
unsigned long flags;
394+
int err;
395+
396+
err = raw_res_spin_lock_irqsave(&rqspinlock, flags);
397+
if (err)
398+
return err;
395399

396-
raw_res_spin_lock_irqsave(&rqspinlock, flags);
397400
cxt.cur_ops->flags = flags;
398401
return 0;
399402
}

0 commit comments

Comments
 (0)