
785 P.2d 172 (1990)
117 Idaho 47
Michael WERLINGER, Petitioner-Appellant,
v.
STATE of Idaho, Respondent.
No. 17937.
Court of Appeals of Idaho.
January 2, 1990.
Michael Werlinger, Boise, pro se.
Jim Jones, Atty. Gen. by Timothy D. Wilson, Deputy Atty. Gen., Boise, for respondent. *173
*174 BURNETT, Judge.
This is a habeas corpus case. Michael Werlinger, a prison inmate, seeks our review of a district court decision upholding a magistrate's order that dismissed Werlinger's petition and awarded attorney fees to the state. The issues are (1) whether a constitutionally protected liberty interest is created by a prison's administrative procedure for reviewing inmate grievances, and (2) whether an award of attorney fees is appropriate in this case. As more fully explained below, we affirm the district court's decision in part and reverse it in part.
The pertinent facts may be stated briefly. In October, 1987, the staff of the Idaho State Correctional Institution (ISCI) prepared several disciplinary offense reports relating to Werlinger's conduct. The conduct and the proposed discipline are not disclosed in the record. Werlinger appealed to the warden in accordance with the prison's grievance review procedure. Under that procedure, as set forth summarily on the offense report forms, the warden was required to act on the appeal within twenty-one days. In December, 1987, having waited six weeks for a response, Werlinger filed a petition for habeas corpus, alleging that the warden had deprived him of a "protected liberty interest."
The magistrate initially directed the state to comply with the grievance review procedure or to show cause why it should not be required to do so. Although the warden could have put this case to rest merely by acting on Werlinger's appeal, the state chose instead to dispute Werlinger's claim of a protected interest. The state argued that the court could not compel compliance with the grievance review procedure because inmates have no liberty interest in the procedure. The magistrate agreed and dismissed the petition. He also awarded attorney fees to the state. On appeal, the district court affirmed. The present appeal followed.

I
The liberty interest question has been framed narrowly by Werlinger's petition. He does not allege that he has suffered, or that he will suffer, any particular form of discipline. Neither does he allege that the warden's failure to act on his appeal was due to any arbitrary or discriminatory practice. Rather, he simply alleges that the warden failed to act within twenty-one days. Thus, the unadorned issue in this appeal is whether an administrative provision for grievance review within twenty-one days embodies a liberty interest.
As used by the parties in this litigation, the phrase "liberty interest" refers to the Fourteenth Amendment's guaranty that no state will deprive a person of life, liberty or property without due process. No separate liberty interest under the state constitution has been argued. The Fourteenth Amendment, as construed by the United States Supreme Court, embraces "a limited range of interests... ." Hewitt v. Helms, 459 U.S. 460, 466, 103 S.Ct. 864, 866, 74 L.Ed.2d 675 (1983). These interests may arise from two sources  the due process clause itself and laws of the state. Meachum v. Fano, 427 U.S. 215, 223-27, 96 S.Ct. 2532, 2537, 49 L.Ed.2d 451 (1976). We will consider each possibility as it relates to this case.
The due process clause has been held to require an administrative hearing where prison discipline entails serious consequences such as the loss of "good time" credits. Wolff v. McDonnell, 418 U.S. 539, 94 S.Ct. 2963, 41 L.Ed.2d 935 (1974). This requirement, so far as it may be applicable here, appears to have been satisfied. But Wolff does not say, nor does it imply, that the prison also must furnish a system of administrative appellate review. See generally Spencer v. Moore, 638 F. Supp. 315 (E.D.Mo. 1986). We hold that the due process clause, by itself, creates no liberty interest in appellate review of inmate discipline. A fortiori, it creates no liberty interest in the completion of discipline review within twenty-one days.
The next question is whether the State of Idaho has created such a liberty interest by establishing the grievance review system in existence at the ISCI. *175 States may create liberty interests, to which the due process clause extends protection, when they enact certain statutory or regulatory measures. Hewitt 459 U.S. at 469, 103 S.Ct. at 870. However, these state-created entitlements acquire constitutional protection only under narrowly defined circumstances. According to the United States Supreme Court, statutes and regulations governing the operations of prison systems create liberty interests only if they are expressed in "mandatory" terms and are based on "specific substantive predicates." Hewitt 459 U.S. at 471, 103 S.Ct. at 871. We interpret this language to mean that the statutes or regulations must establish or recognize substantive rights, rather than merely providing procedural mechanisms for the exercise of administrative discretion. Where prison officials are given substantively unfettered discretion, no liberty interest exists even if the exercise of that discretion is procedurally regulated. Olim v. Wakinekona, 461 U.S. 238, 250, 103 S.Ct. 1741, 75 L.Ed.2d 813 (1983). The Supreme Court's reasoning in this regard has been criticized, see L. TRIBE, AMERICAN CONSTITUTIONAL LAW (2d ed. 1988), but it is binding upon us in applying the Fourteenth Amendment.
Here, the prison's grievance review system contains mandatory language: the warden is required to respond to an appeal within twenty-one days. However, it does not establish or recognize an underlying substantive right. It simply channels the warden's exercise of discretion in reviewing inmate appeals. Moreover, it does not provide a substantive consequence, such as amelioration of discipline, if the warden's review is not completed within the specified time. Accordingly, we conclude that the twenty-one day review period does not create a liberty interest protected by the due process clause of the Fourteenth Amendment.
We couple our conclusion with a caveat that the warden may not arbitrarily ignore the appeals of some inmates while acting on others. Where a statutory or regulatory procedure exists, it cannot be subverted by discriminatory application. See generally Lee v. Washington, 390 U.S. 333, 88 S.Ct. 994, 19 L.Ed.2d 1212 (1968) (racial discrimination in prisons offends equal protection clause of Fourteenth Amendment); Freeman v. State, 116 Idaho 985, 783 P.2d 324 (Ct. App. 1989) (parole commission may not refuse, upon mistake of law, to consider parole for some inmates who are statutorily eligible). In the present case, Werlinger's petition alleges no such discrimination. The petition was properly dismissed.

II
We turn next to the attorney fee issue. The magistrate based the award in this case upon I.C. § 12-122. The statute provides that attorney fees shall be awarded to the respondent if an inmate of a state prison or county jail files a petition which the court deems to be frivolous. Werlinger contends that his petition was not frivolous and that I.C. § 12-122 violates equal protection by focusing only upon those habeas corpus petitioners who are inmates. Because we agree with the first contention, we need not address the second.
The determination as to whether a petition is frivolous rests in the trial court's sound discretion. See, e.g., Anderson v. Ethington, 103 Idaho 658, 651 P.2d 923 (1982) (construing a similar statute, I.C. § 12-121). However, such discretion must be exercised in accordance with applicable legal standards. Associates Northwest, Inc. v. Beets, 112 Idaho 603, 733 P.2d 824 (Ct.App. 1987). We have held that where, as here, questions of law are raised, the nonprevailing party's position is not automatically frivolous simply because the court is unpersuaded. Rather, the test is whether the nonprevailing party's position is plainly fallacious and, therefore, not fairly debatable. Gulf Chemical Employees Federal Credit Union v. Williams, 107 Idaho 890, 693 P.2d 1092 (Ct.App. 1984). Here, the magistrate failed to apply this test. He simply held that the petition was frivolous because it was dismissed for failure to state a claim upon which relief could be granted. This was error.
*176 Ordinarily, when an exercise of discretion is infected by legal error, the case will be remanded for reconsideration in light of the clarified legal standard. Matter of Estate of Kunzler, 109 Idaho 350, 355, 707 P.2d 461, 466 (Ct.App. 1985). However, we need not remand the case if the issue yields such a clear answer that any other result would constitute an abuse of discretion. Id. at 355, 707 P.2d at 466. In this case, we think it is manifestly clear that Werlinger's petition was not frivolous. Werlinger raised a legal question which was fairly debatable and which had not yet been resolved by an appellate decision in this state. We hold that attorney fees should not have been awarded.
In sum, we affirm that part of the district court's decision which upholds the order dismissing the habeas corpus petition; but we reverse that part of the decision which upholds the award of attorney fees. No costs or attorney fees are awarded in this appeal.
WALTERS, C.J., and SWANSTROM, J., concur.
