diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-10-17 16:24:38 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-10-17 16:24:38 +0300 |
commit | 4d82702871393bfb2597a6fc43dc43c3dc67318a (patch) | |
tree | fd1f4cd33a33d4de96c5ace597ba9197d60756c9 /fs/ntfs3/fslog.c | |
parent | 7dea6e7a6446903630a325088d8890eedc262328 (diff) | |
parent | e9448e371c87c76f9133bb3b27918854f4dc087b (diff) | |
download | linux-rolling-lts.tar.xz |
Merge v6.6.57linux-rolling-lts
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/ntfs3/fslog.c')
-rw-r--r-- | fs/ntfs3/fslog.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/fs/ntfs3/fslog.c b/fs/ntfs3/fslog.c index 231b012fb19d..2a1aeab53ea4 100644 --- a/fs/ntfs3/fslog.c +++ b/fs/ntfs3/fslog.c @@ -609,14 +609,29 @@ static inline void add_client(struct CLIENT_REC *ca, u16 index, __le16 *head) *head = cpu_to_le16(index); } +/* + * Enumerate restart table. + * + * @t - table to enumerate. + * @c - current enumerated element. + * + * enumeration starts with @c == NULL + * returns next element or NULL + */ static inline void *enum_rstbl(struct RESTART_TABLE *t, void *c) { __le32 *e; u32 bprt; - u16 rsize = t ? le16_to_cpu(t->size) : 0; + u16 rsize; + + if (!t) + return NULL; + + rsize = le16_to_cpu(t->size); if (!c) { - if (!t || !t->total) + /* start enumeration. */ + if (!t->total) return NULL; e = Add2Ptr(t, sizeof(struct RESTART_TABLE)); } else { |