This is currently not strictly necessay, because the
only caller catches the DBWRAP_LOCK_ORDER_NONE case,
and maximum is already checked, but this seems too dangerous to me.
Use the new DBWRAP_LOCK_ORDER_VALID() macro.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
static struct db_context *locked_dbs[DBWRAP_LOCK_ORDER_MAX];
struct dbwrap_lock_order_state *state = NULL;
- if (db->lock_order > DBWRAP_LOCK_ORDER_MAX) {
+ if (!DBWRAP_LOCK_ORDER_VALID(db->lock_order)) {
DEBUG(0,("Invalid lock order %d of %s\n",
(int)db->lock_order, db->name));
smb_panic("invalid lock_order\n");