svn commit: r309891 - head/sys/kern
Konstantin Belousov
kostikbel at gmail.com
Mon Dec 12 16:33:41 UTC 2016
On Mon, Dec 12, 2016 at 03:22:22PM +0000, Edward Tomasz Napierala wrote:
> Author: trasz
> Date: Mon Dec 12 15:22:21 2016
> New Revision: 309891
> URL: https://svnweb.freebsd.org/changeset/base/309891
>
> Log:
> Avoid dereferencing NULL pointers in devtoname(). I've seen it panic,
> called from ufs_print() in DDB.
Calls from DDB should not panic even if accessing NULL pointers.
That said, I also do not think that this is the right place to change.
UFS um_dev should not be NULL for any active mount.
>
> MFC after: 1 month
>
> Modified:
> head/sys/kern/kern_conf.c
>
> Modified: head/sys/kern/kern_conf.c
> ==============================================================================
> --- head/sys/kern/kern_conf.c Mon Dec 12 15:17:56 2016 (r309890)
> +++ head/sys/kern/kern_conf.c Mon Dec 12 15:22:21 2016 (r309891)
> @@ -1230,6 +1230,9 @@ const char *
> devtoname(struct cdev *dev)
> {
>
> + if (dev == NULL)
> + return (NULL);
> +
> return (dev->si_name);
> }
>
More information about the svn-src-all
mailing list