Thread (21 messages) 21 messages, 2 authors, 2020-05-09

Re: [PATCH v4 00/12] pstore: mtd: support crash log to block and mtd device

From: Kees Cook <hidden>
Date: 2020-05-09 19:10:50
Also in: lkml

On Sat, May 09, 2020 at 06:32:28PM +0800, WeiXiong Liao wrote:
quoted hunk ↗ jump to hunk
The following diff is to fix "rmmod" bug.
@@ -1273,8 +1273,8 @@ static void psz_free_zones(struct pstore_zone
***pszones, unsigned int *cnt)
                return;

        while (*cnt > 0) {
-               psz_free_zone(&zones[*cnt]);
                (*cnt)--;
+               psz_free_zone(&zones[*cnt]);
        }
        kfree(zones);
        *pszones = NULL;
Ah-ha! Thanks; I'd almost found that. I got confused because I wasn't
see NULL free()s, and I finally noticed that the zones had left over
ERR_PTRs:

        if (IS_ERR(cxt->fpszs)) {
                err = PTR_ERR(cxt->fpszs);
+               cxt->fpszs = NULL;
                goto free_out;
        }

I'll fix those and your v5 and my lastest tree merged.

-- 
Kees Cook
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help