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/[email protected] Fixes: f5f0e5a ("selftests/damon/_damon_sysfs: implement kdamonds start function") Signed-off-by: SeongJae Park <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Shuah Khan <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent b96a303 commit 732b881

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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)