Skip to content

Commit 732b881

Browse files
sjp38akpm00
authored andcommitted
selftests/damon/_damon_sysfs: check errors from nr_schemes file reads
DAMON context staging method in _damon_sysfs.py is not checking the returned error from nr_schemes file read. Check it. Link: https://lkml.kernel.org/r/20240503180318.72798-3-sj@kernel.org Fixes: f5f0e5a ("selftests/damon/_damon_sysfs: implement kdamonds start function") Signed-off-by: SeongJae Park <sj@kernel.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent b96a303 commit 732b881

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

tools/testing/selftests/damon/_damon_sysfs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,8 @@ def stage(self):
341341
nr_schemes_file = os.path.join(
342342
self.sysfs_dir(), 'schemes', 'nr_schemes')
343343
content, err = read_file(nr_schemes_file)
344+
if err is not None:
345+
return err
344346
if int(content) != len(self.schemes):
345347
err = write_file(nr_schemes_file, '%d' % len(self.schemes))
346348
if err != None:

0 commit comments

Comments
 (0)