
126 Ill. App.3d 577 (1984)
467 N.E.2d 1061
FIRST STATE BANK OF ROUND LAKE, Plaintiff-Appellee,
v.
NORMAN BUSSE, Defendant-Appellant.
No. 83-1832.
Illinois Appellate Court  First District (5th Division).
Opinion filed August 3, 1984.
Rehearing denied August 29, 1984.
*578 John G. Sommesi, of Burfeind & Schlickman, Ltd., of Arlington Heights, for appellant.
Charles W. Siragusa, of Crowley, Barrett & Karaba, of Chicago, for appellee.
Reversed and remanded.
PRESIDING JUSTICE MEJDA delivered the opinion of the court:
Plaintiff, First State Bank of Round Lake (the Bank), brought action on a promissory note executed by Busse Chevrolet, Inc. (the dealer), as principal, against defendant Norman Busse as guarantor thereon. On June 30, 1983, the court granted plaintiff's motion for summary judgment for $31,832.54 based on the principal amount of $25,000. Thereafter, on July 8, 1983, the court awarded plaintiff $2,685 as attorney fees. Defendant appeals from the summary judgment and the order. We reverse and remand with directions.
This case arose out of various financing agreements between the Bank and Busse Chevrolet, Inc., an automobile dealer. As pertinent to this appeal, the dealer executed two notes in favor of the Bank. One was in the principal amount of $45,000 and was not guaranteed by any third party. The other note was in the principal amount of $25,000 and was personally guaranteed by defendant. The dealer apparently defaulted on both notes and the Bank set off against the amounts due under the notes funds which had been deposited in the dealer's checking account with the Bank. The notes gave the Bank the right to set off funds which the dealer had deposited with it, and to apply the setoffs in any order.
*579 The funds which the Bank used to set off the notes were allegedly the proceeds from the sale of cars which were subject to security interests of General Motors Acceptance Corporation (GMAC). On April 19, 1980, the Bank set off $45,000 against the $45,000 dealer's unguaranteed note and also set off $8,641.25 against the dealer's $25,000 note, personally guaranteed by defendant. On April 21, 1980, the Bank set off an additional $11,678.10 against the $25,000 note, leaving a balance of $4,680.65.
On April 21, 1980, the dealer filed for bankruptcy. In that proceeding GMAC made a demand against the funds which the Bank had used to set off the amounts due under the notes. GMAC asserted that the funds were proceeds from the sale of automobiles to which it held perfected security interests and that GMAC was therefore entitled to the amount of the funds. In an "Agreed Order" signed by counsel for the Bank and GMAC, the bankruptcy court ordered that "First National Bank of Round Lake * * * may retain $65,319.35 set off by the Bank against the balance in Busse Chevrolet, Inc.'s Account No. 1108110. * * * The Bank is hereby authorized to pay, pursuant to the attached settlement agreement, to General Motors Acceptance Corporation the sum of $45,000 in settlement of its claim."
Subsequently, the Bank reversed the credits against the $25,000 note personally guaranteed by defendant and purported to deduct from the setoff to the $45,000 note the $45,000 which it had paid to GMAC. The Bank then applied the $20,319.35 which had just been reversed from the setoff against the $25,000 note and applied that amount to the $45,000 note. The Bank then sued defendant for the full $25,000 which it claimed was then due under the $25,000 note. The trial court granted the Bank's motion for summary judgment and in a subsequent order awarded the Bank attorney fees of $2,685. Defendant thereafter appealed.

OPINION
 1 The Bank's claim that it properly set off various deposits and reversed the credit previously applied to the $25,000 note is based on its assertion that the setoffs were inherently conditional on the finality of the Bank's right to the amounts deposited. (See Baxter v. Continental Illinois National Bank & Trust Co. (1940), 304 Ill. App. 117, 125-26, 26 N.E.2d 179; see also Annot., 21 A.L.R. 704, 712-13 (1922).) The Bank's right to set off is based on its contract with Busse Chevrolet, Inc., and was memorialized in the notes securing the loans. Each note allowed the Bank to apply any of the dealer's deposits or other funds toward the payment of the liabilities represented by the *580 notes. The contracts also gave the Bank the right to apply the setoffs in any order. We therefore conclude that the setoffs of April 19 and 21, 1980, were proper.
The issue thus becomes whether the Bank's subsequent deduction of $45,000 from the setoff to the note in that amount and the Bank's reversal of the $20,319.35 credit against the $25,000 note were proper.
The Bank contends that it acted properly because it would have been required to surrender the full amounts of the setoffs because GMAC had a superior right to the funds as proceeds of the sale of items in which GMAC had security interests and, alternatively, because the setoffs would have constituted impermissible preferences. While these assertions may or may not be true, the record reflects that the Bank was in fact allowed to retain the full $65,319.35 which had been in the dealer's checking account and that the $45,000 settlement with GMAC was derived from some other source. The Bank has not challenged the propriety of the bankruptcy court's order and indeed has relied on it in support of its motion for summary judgment. Consequently, the Bank's right to the funds in the checking account was established by the bankruptcy court's order and accordingly there was no basis for reversing any of the credits.
 2 We therefore hold that the obligations of defendant, as guarantor of the $25,000 note, were extinguished to the extent of the setoffs. (See Miller v. Montgomery (1863), 31 Ill. 350, 352; Du Quoin State Bank v. Daulby (1983), 115 Ill. App.3d 183, 185, 450 N.E.2d 347; Mazur v. Stein (1942), 314 Ill. App. 529, 532, 41 N.E.2d 979.) Because the Bank's right to the funds used to set off the balance due under the note was finally established by the bankruptcy court's order, the setoffs were final insofar as the rights of defendant are concerned. Miller v. Montgomery (1863), 31 Ill. 350, 352; compare Baxter v. Continental Illinois National Bank & Trust Co. (1940), 304 Ill. App. 117, 26 N.E.2d 179.
The $45,000 settlement with GMAC may arguably have given the Bank certain rights of recovery against the dealer; however, defendant never contracted to undertake such an obligation. (Cf. Annot., 21 A.L.R. 704, 713 (1922).) We recognize that the Bank will be unable to collect anything from the bankrupt corporation, but such a situation does not form a proper basis for imposing liability on defendant.
Inasmuch as there is no dispute as to any material fact, but only as to the legal effect of the facts, summary judgment is appropriate. (See generally Ill. Rev. Stat. 1983, ch. 110, par. 2-1005(c); Fooden v. Board of Governors (1971), 48 Ill.2d 580, 272 N.E.2d 497.) We therefore *581 reverse the order of the trial court and remand with directions to enter summary judgment for plaintiff for $4,680.65, which represents the undisputed principal balance due on the note, together with interest computed thereon as provided in the note.
 3 The trial court's order of July 8, 1983, awarded the Bank $2,685 as attorney fees based on a provision in the note by which defendant obligated to "pay all expenses of the Bank of collection of this Note, * * * including reasonable attorneys' fees and legal expenses * * *." Because we have held that the Bank did not have the right to collect on the note to the extent claimed, we reverse the order of attorney fees and remand for the determination of reasonable fees and expenses, limited and payable as to the balance of $4,680.65 and interest, admittedly not discharged by the setoffs. However, the Bank is only entitled to the reasonable fees and legal expenses incurred in recovery on the note itself, not in pursuing the entire litigation. Main Bank v. Baker (1980), 88 Ill. App.3d 28, 35-36, 410 N.E.2d 681, aff'd in part, rev'd in part on other grounds (1981), 86 Ill.2d 188, 427 N.E.2d 94.
Accordingly, the summary judgment entered June 30, 1983, and the order awarding attorney fees entered July 8, 1983, are reversed and the cause remanded with directions.
Reversed and remanded with directions.
LORENZ and SULLIVAN, JJ., concur.
