George C. Spacek, holder of a trust deed on a piece of real property held by the debtor in a bankruptcy case, brought suit in bankruptcy court against Jerry Thomen, the holder of. the first trust deed on the same piece of real property. Spacek claims that Thomen's trust deed should be equitably subordinated or, alternatively, that the first trust deed merged with the title to the property. We reject both contentions.
In February 1983, Thomen, the lawyer and business associate of Kewars Tabata-bay (“Tabatabay”), purchased from a third party the first deed of trust on a property owned by Universal Farming Industries (“UFI”). UFI had filed a bankruptcy petition under Chapter 11 on January 11, 1983.
Spacek, holder of a deed of trust on the same real property, brought suit in the bankruptcy court, claiming that Thomen’s claim should be equitably subordinated, or, alternatively, that the first deed of trust merged with the title to the real property. The bankruptcy court granted judgment for Thomen. Following the judgment, a number of creditors, including Thomen and Spacek, and the debtor stipulated to the dismissal of the debtor’s Chapter 11 case. This stipulation expressly included a provision that the bankruptcy court would retain jurisdiction of this case. The district court affirmed the ruling of the bankruptcy court. Spacek filed a timely appeal.
DISCUSSION
1. Is the case moot due to the dismissal of the underlying bankruptcy?
Spacek asserts that this case is moot, due to the dismissal of the underlying bankruptcy. We disagree.
In the bankruptcy context the determination of whether a case becomes moot on the dismissal of the bankruptcy hinges on the question of how closely the issue in the case is connected to the underlying bankruptcy. See In re Omoto, 85 B.R. 98, 100 (Bankr. 9th Cir.1988); In re Dahlquist, 751 F.2d 295, 298 (8th Cir.1985). When the issue being litigated directly involves the debtor’s reorganization, the case is mooted by the dismissal of the bankruptcy. Thus, for example, an appeal of a denial of a motion to reimpose the automatic stay under 11 U.S.C. § 362(a) was dismissed as moot on the dismissal of the bankruptcy case. In re Income Property Builders, 699 F.2d 963, 964 (9th Cir.1982). However, if the issue is ancillary to the bankruptcy, the dismissal of the petition does not necessarily cause the case to become moot. For example, the Ninth Circuit held that the dismissal of a petition in bankruptcy did not bar an application for compensation for services rendered in connection with the bankruptcy. See U.S.A. Motel Corp. v. Panning, 521 F.2d 117 (9th Cir.1975).
Here, the controversy about the priority of Thomen’s trust deed appears not to be so closely linked to the underlying bankruptcy that the dismissal of the Chapter 11 case renders the case moot. Presumably, even outside the bankruptcy context the value of Spacek’s trust deed depends in part on the validity of Thomen’s apparently prior trust deed. This would be true even *1336if UFI, the corporation against which the two claims are held, is solvent and able to pay all creditors fully. The value of the claims against UFI will depend in part on how many claims will precede them in a potential insolvency. Thus, a legally cognizable interest in the outcome of the ease survives the bankruptcy. We therefore consider the merits of the case.
2. Did the first deed of trust merge with the title of the real property?
Spacek contends that the claim represented by the first trust deed merged with the ownership interest in the property. We evaluate this claim under California law. See Firstmark Capital Corp. v. Hempel Fin. Corp., 859 F.2d 92, 93 (9th Cir.1988). The parties do not dispute that the law of California is controlling, and California is the forum state, so California law should govern. Id. (citation omitted).
In order to succeed on a merger of title theory, Spacek must show that the same entity owns both the trust deed and the property. Thomen appears to own the trust deed, while UFI owns the property. However, Spacek argues that in fact Taba-tabay owned both the trust deed and the property.1 Spacek asserts that the connection between Tabatabay, Thomen, and UFI was such that Tabatabay, through his control of Thomen, was the true owner of the trust deed and that Tabatabay was the alter ego of UFI. However, the facts as found by the bankruptcy court do not support this contention and we decline to hold those findings of fact clearly erroneous.
Spacek asserts that Tabatabay controlled Thomen, or that the two acted in concert to such an extent as to make Tabatabay the owner of the trust deed for purposes of merger. Spacek sets forth the following claims to support this assertion: (1) Tho-men was Tabatabay’s in-house counsel; (2) Tabatabay exercised control in a number of ways over the first trust deed; and (3) Thomen was closely involved with Tabata-bay in a number of transactions. The second of these claims appears to be largely unsupported by the evidence in the case. Even if true, neither of the other two claims is sufficient on the facts of this case to overrule the bankruptcy court’s finding that no agency relationship existed between Thomen and Tabatabay as to the purchase of the first trust deed. Similarly, Spacek fails to indicate any portion of the record that supports the claim that Tabata-bay was the alter ego of UFI.
We therefore find that the bankruptcy court did not err in refusing to find merger of title.
3. Should Thomen’s claim be equitably subordinated?
The bankruptcy code does not specify the circumstances under which claims may be equitably subordinated. 11 U.S.C. § 510(c) provides:
[T]he court may—
(1) under principles of equitable subordination, subordinate for purposes of distribution all or part of an allowed claim to all or part of another allowed claim or all or part of an allowed interest to all or part of another allowed interest; or
(2) order that any lien securing such a subordinated claim be transferred to the estate.
*1337Standards for equitable subordination have evolved over the years. Equitable subordination requires that: (1) the claimant who is to be subordinated has engaged in inequitable conduct; (2) the misconduct results in injury to competing claimants or an unfair ’ advantage to the claimant to be subordinated; and (3) subordination is not inconsistent with bankruptcy law. See Wardley Int’l Bank, Inc. v. Nasipit Bay Vessel, 841 F.2d 259, 263 (9th Cir.1988); In re Christian Life Center, 821 F.2d 1370, 1377 (9th Cir.1987). Because bankruptcy courts exercise broad equitable power to subordinate claims, we review the bankruptcy court’s decision for abuse of discretion. In re Christian Life Center, 821 F.2d at 1376. The bankruptcy court implicitly found that the first condition was not met when it determined that Spacek was not damaged. We agree with that finding.
Spacek claims that the transaction by which Thomen acquired the trust deed harmed him in three ways.
First, he contends that he was harmed by the fact that the trust deed was not first offered to other creditors. However, the bankruptcy court found that the deed of trust was offered to a number of people, including Spacek, before it was offered to Thomen. The court found not credible Spa-cek’s denial that such an offer was made to him. On our review of the evidence, we do not find this credibility determination to be erroneous.
Second, Spacek alleges that the claims of creditors, including himself, may not be paid in full due to Thomen’s acquisition of the first trust deed. Even if true, this claim does not represent a legally cognizable injury. The risk that Spacek’s claim may not be satisfied is not the result of the machinations of Thomen or Tabatabay, but follows inevitably from Spacek’s status of junior creditor.
Third, Spacek contends that he was harmed by having a hostile lienholder senior to him. He cites no case suggesting that he has a legal right to a friendly holder of the first trust deed.
Spacek points, however, to In re Pacific Express, Inc., 69 B.R. 112 (Bankr. 9th Cir. 1986), where the court stated that where the holder of a claim is an insider, his dealings with the debtor will receive more intensive scrutiny than a noninsider’s would. Id. at 116 (citations omitted). Spa-cek argues that Thomen is an insider, and therefore once Spacek comes forward with sufficient substantiations of Thomen’s misconduct, the burden shifts to the insider to demonstrate that any challenged transaction was an arms-length bargain. Id. (citations omitted). The bankruptcy court’s findings, however, indicate that Spacek did not sufficiently substantiate his allegations of Thomen’s misconduct; moreover, it is questionable whether Thomen falls under the Bankruptcy Code definition of an insider. 11 U.S.C. § 101(30)(B).
Because Spacek is unable to show any legally cognizable harm to him or any other creditor, or any unfair advantage accruing to Thomen, resulting from Thomen’s purchase of the first trust deed, we conclude that the bankruptcy court did not abuse its discretion in determining that equitable subordination was not available. See In re Christian Life Center, 821 F.2d at 1376.
4. Should sanctions be granted against Spacek?
Thomen requests sanctions against Spacek for bringing a frivolous appeal under Fed.R.App.P. 38. This rule provides: “If a court of appeals shall determine that an appeal is frivolous, it may award just damages and single or double costs to the appellee.” An appeal is frivolous if the result is obvious or the arguments of error are wholly without merit. See Swimmer v. IRS, 811 F.2d 1343, 1345 (9th Cir.1987).
We find that Spacek’s contentions lack merit and statements in his brief are in large part unsupported by the record. Because we find the appeal is indeed frivolous, we assess attorney fees on appeal and double costs. The matter is transferred to the district court for determination of amount of attorney fees on appeal.
*1338AFFIRMED, but TRANSFERRED to district court for determination of attorney fees.