Skip to content

Commit

Permalink
11922 ipmi_open looks for wrong return value
Browse files Browse the repository at this point in the history
Reviewed by: Marcel Telka <marcel@telka.sk>
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Andy Stormont <AStormont@racktopsystems.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: John Levon <john.levon@joyent.com>
Approved by: Dan McDonald <danmcd@joyent.com>
  • Loading branch information
Jason King authored and Dan McDonald committed Nov 7, 2019
1 parent 3423c61 commit 22f89f9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions usr/src/uts/intel/io/ipmi/ipmi_main.c
Expand Up @@ -20,7 +20,7 @@
*/

/*
* Copyright 2017 Joyent, Inc.
* Copyright 2019 Joyent, Inc.
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
*/

Expand Down Expand Up @@ -151,6 +151,7 @@ ipmi_open(dev_t *devp, int flag, int otyp, cred_t *cred)
{
minor_t minor;
ipmi_device_t *dev;
id_t mid;

if (ipmi_attached == B_FALSE)
return (ENXIO);
Expand All @@ -162,8 +163,9 @@ ipmi_open(dev_t *devp, int flag, int otyp, cred_t *cred)
if (flag & FEXCL)
return (ENOTSUP);

if ((minor = (minor_t)id_alloc_nosleep(minor_ids)) == 0)
if ((mid = id_alloc_nosleep(minor_ids)) == -1)
return (ENODEV);
minor = (minor_t)mid;

/* Initialize the per file descriptor data. */
dev = kmem_zalloc(sizeof (ipmi_device_t), KM_SLEEP);
Expand Down

0 comments on commit 22f89f9

Please sign in to comment.