Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic fix off-by-one error in namespace id range check.
details: https://anonhg.NetBSD.org/src/rev/8ff32da4c693
branches: trunk
changeset: 347640:8ff32da4c693
user: nonaka <nonaka%NetBSD.org@localhost>
date: Thu Sep 08 04:41:16 2016 +0000
description:
fix off-by-one error in namespace id range check.
diffstat:
sys/dev/ic/nvme.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diffs (36 lines):
diff -r 69f245f3b97d -r 8ff32da4c693 sys/dev/ic/nvme.c
--- a/sys/dev/ic/nvme.c Thu Sep 08 02:57:32 2016 +0000
+++ b/sys/dev/ic/nvme.c Thu Sep 08 04:41:16 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nvme.c,v 1.3 2016/06/04 16:11:51 nonaka Exp $ */
+/* $NetBSD: nvme.c,v 1.4 2016/09/08 04:41:16 nonaka Exp $ */
/* $OpenBSD: nvme.c,v 1.49 2016/04/18 05:59:50 dlg Exp $ */
/*
@@ -18,7 +18,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.3 2016/06/04 16:11:51 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.4 2016/09/08 04:41:16 nonaka Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1559,7 +1559,7 @@
return ENXIO;
nsidx = nsid - 1;
- if (nsidx > sc->sc_nn || sc->sc_namespaces[nsidx].dev == NULL)
+ if (nsidx >= sc->sc_nn || sc->sc_namespaces[nsidx].dev == NULL)
return ENXIO;
if (ISSET(sc->sc_namespaces[nsidx].flags, NVME_NS_F_OPEN))
return EBUSY;
@@ -1586,7 +1586,7 @@
return ENXIO;
nsidx = nsid - 1;
- if (nsidx > sc->sc_nn)
+ if (nsidx >= sc->sc_nn)
return ENXIO;
CLR(sc->sc_namespaces[nsidx].flags, NVME_NS_F_OPEN);
Home |
Main Index |
Thread Index |
Old Index