From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Dilger Subject: Re: [PATCH] Allow kernel-only mount interfaces... Date: Thu, 10 Feb 2005 12:01:13 -0700 Message-ID: <20050210190113.GT2635@schnapps.adilger.int> References: <1108060883.9757.33.camel@lade.trondhjem.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="flpRHSNNLnUanxKW" Cc: Linux Filesystem Development Received: from moraine.clusterfs.com ([66.96.26.190]:5606 "EHLO moraine.clusterfs.com") by vger.kernel.org with ESMTP id S261290AbVBJTBQ (ORCPT ); Thu, 10 Feb 2005 14:01:16 -0500 To: Trond Myklebust Content-Disposition: inline In-Reply-To: <1108060883.9757.33.camel@lade.trondhjem.org> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org --flpRHSNNLnUanxKW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Feb 10, 2005 13:41 -0500, Trond Myklebust wrote: > +struct vfsmount * > +do_kern_mount(const char *fstype, int flags, const char *name, void *data) > +{ > + struct file_system_type *type = get_fs_type(fstype); > + struct vfsmount *mnt = vfs_kern_mount(type, flags, name, data); > + put_filesystem(type); > + return mnt; > +} This will OOPS if fstype is bad, since you unconditionally put_filesystem() on a possible PTR_ERR() type. You need an extra if (!IS_ERR(type)) put_filesystem(type); Cheers, Andreas -- Andreas Dilger http://sourceforge.net/projects/ext2resize/ http://members.shaw.ca/adilger/ http://members.shaw.ca/golinux/ --flpRHSNNLnUanxKW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQFCC694pIg59Q01vtYRArIhAKCekVI3+ayjaCtGldCo9fjhhxcNIwCgkt6s JkeVWE65B75ku3mbukCO0Do= =uJE+ -----END PGP SIGNATURE----- --flpRHSNNLnUanxKW--