Skip to contentSkip to conversation

nfs: Fix nfs_parse_mount_options() kfree() leak

PATCH New Trond Myklebust 1 participant 1 message Oct 20, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs: Fix nfs_parse_mount_options() kfree() leak

From: Yinghai Lu <[email protected]>

Fix a (small) memory leak in one of the error paths of the NFS mount options parsing code.

---
Regression introduced in 2.6.30 by commit a67d18f (NFS: load the rpc/rdma transport module automatically). Please apply to mainline +stable...

 fs/nfs/super.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
fs/nfs/super.c +1 -0
index a2c18ac..90be551 100644
@@ -1253,6 +1253,7 @@ static int nfs_parse_mount_options(char *raw,
                        default:
                                dfprintk(MOUNT, "NFS:   unrecognized "
                                                "transport protocol\n");
+                               kfree(string);
                                return 0;
                        }
                        break;