Exhibit 10.4

SECOND AMENDMENT AGREEMENT, dated as of September 26, 2014 (this Second
Amendment Agreement), between CM FINANCE SPV LTD., an exempted company
incorporated with limited liability under the laws of the Cayman Islands, as
issuer (the Issuer); and STATE STREET BANK AND TRUST COMPANY, a Massachusetts
trust company, as trustee (in such capacity, together with its permitted
successors and assigns in the trusts under the Indenture, the Trustee) and,
solely as expressly specified in the Indenture, in its individual capacity (the
Bank).

WHEREAS, the Issuer, the Trustee and the Bank have previously entered into that
certain Indenture, dated as of May 23, 2013 (as supplemented by the First
Supplemental Indenture, dated as of June 6, 2013, between the Issuer and the
Trustee and amended and restated by the Amendment Agreement dated as of
December 4, 2013 between the Issuer, the Trustee and the Bank, the Original
Indenture), between the Issuer, the Trustee and the Bank.

WHEREAS, the parties agree that this Second Amendment Agreement shall constitute
a supplemental indenture for purposes of Article VIII of the Indenture and wish
to amend and restate the Original Indenture by entering into this Second
Amendment Agreement.

WHEREAS, Section 8.2 of the Original Indenture provides that the Original
Indenture may be amended for a purpose not permitted under Section 8.1 of the
Original Indenture, with the written consent of each Holder and the Collateral
Manager.

WHEREAS, the Issuer has requested that, pursuant to and in accordance with the
terms and conditions of this Second Amendment Agreement, the Trustee enter into,
and that each Holder and the Collateral Manager consent to, the Second Amended
and Restated Indenture, dated as of September 26, 2014 (as attached hereto as
Exhibit A, the Indenture), between the Issuer, the Trustee and the Bank,
pursuant to which the Issuer proposes to (a) extend the maturity of the Class A
Notes and increase the aggregate principal amount thereof to U.S.$200,000,000
(the Class A Notes Amendments) and (b) extend the maturity of the Class A-R
Notes and reduce the aggregate funded and unfunded commitment amount thereof to
U.S.$100,000,000 (the Class A-R Notes Amendments) in accordance with (i) the
Revolving Credit Note Agreement, dated as of December 4, 2013, as amended and
restated pursuant to the Amended and Restated Revolving Credit Note Agreement as
of September 26, 2014 (the Revolving Credit Note Agreement), between the Issuer,
each entity party thereto as a Class A-R Noteholder, State Street Bank and Trust
Company, as revolving credit note agent, and the Trustee; and (ii) the Class A
Placement Agency Agreement, dated as of May 23, 2013, as amended and restated
pursuant to the Amended and Restated Placement Agency Agreement as of
September 26, 2014 (the Class A Placement Agency Agreement), between the Issuer
and UBS Securities LLC, as placement agent.

 

Page 1

--------------------------------------------------------------------------------

ACCORDINGLY, in consideration of the promises and the mutual agreements
contained herein, and for other good and valuable consideration, the receipt and
sufficiency of which are hereby acknowledged, the parties hereto agree as
follows:

 

1. Definitions

Capitalized terms used but not defined herein have the respective meanings given
to such terms in the Original Indenture.

 

2. Amendments

With effect from and including the Effective Date (as defined in Section 3), the
Original Indenture shall be amended and restated so that it shall be read and
construed as set out in the Indenture attached hereto as Exhibit A.

 

3. Conditions Precedent to Effective Date

This Second Amendment Agreement shall become effective on and as of the date
(the Effective Date) on which each of the following conditions precedent shall
have been satisfied:

 

(a) Second Amendment Agreement. This Second Amendment Agreement shall have been
duly executed and delivered by each party hereto.

 

(b) Indenture. The Indenture shall have been duly executed and delivered by each
party thereto.

 

(c) Revolving Credit Note Agreement. The Revolving Credit Note Agreement shall
have been duly executed and delivered by each party thereto.

 

(d) Class A Placement Agency Agreement. The Class A Placement Agency Agreement
shall have been duly executed and delivered by each party thereto.

 

(e) Amendments to Transaction Documents. Amendments to each of the following
Transaction Documents shall have been duly executed and delivered by each party
thereto: (i) the Collateral Management Agreement and (ii) the Collateral
Administration Agreement (collectively, together with the Revolving Credit Note
Agreement and the Class A Placement Agency Agreement, the Amendment Documents).

 

(f) Representations and Warranties. Each of the representations and warranties
contained in the Indenture, this Second Amendment Agreement and each Amendment
Document described in sub-section (d) is true and correct on and as of the
Effective Date with the same force and effect as if made on and as of the
Effective Date (or, if any such representation or warranty is expressly stated
to have been made as of a specific date, as of such specific date).

 

(g) No Event of Default. No Event of Default shall have occurred and be
continuing.

 

Page 2

--------------------------------------------------------------------------------

(h) Corporate Documents. The Trustee shall have received in form and substance
reasonably satisfactory to the Trustee the following corporate documents:

 

  (i) Officers’ Certificates of the Issuer.

 

  (A) An Officer’s certificate of the Issuer, dated as of the date hereof,
(A) evidencing the authorization of the execution and delivery on behalf of the
Issuer of (1) the Amendment Documents to which the Issuer is a party; and
(2) such related documents as may be required for the purpose of the Class A
Notes Amendments and the Class A-R Notes Amendments and the transactions
contemplated in the Indenture, this Second Amendment Agreement and the Amendment
Documents; and (B) certifying that (1) the copies of the Authorizing Resolution
and Constitutive Documents attached thereto are, in each case, a true and
complete copy thereof; (2) such authorizations have not been amended or
rescinded and are in full force and effect on and as of the date hereof; and
(3) the Officers of the Issuer authorized to execute and deliver such documents
hold the offices and have the signatures indicated thereon.

 

  (B) An Officer’s certificate of the Issuer, dated as of the date hereof,
stating that, to the Officer’s knowledge, (i) the Issuer is not in default under
the Indenture; (ii) the Class A Notes Amendments and the Class A-R Notes
Amendments will not result in a default or a breach of any of the terms,
conditions or provisions of, or constitute a default under, its organizational
documents, any indenture or other agreement or instrument to which it is a party
or by which it is bound, or any order of any court or administrative agency
entered in any Proceeding to which it is a party or by which it may be bound or
to which it may be subject; (iii) if applicable, all conditions precedent
provided in the Indenture relating to the Class A Notes Amendments and Class A-R
Notes Amendments have been complied with; (iv) if applicable, all expenses due
or accrued with respect to the Class A Notes Amendments and the Class A-R Notes
Amendments or relating to actions taken on or in connection with the date hereof
have been paid or reserves therefor have been made; and (v) all of its
representations and warranties contained in the Indenture, this Second Amendment
Agreement and each Amendment Document are true and correct as of the date
hereof.

 

  (ii)

Officers’ Certificate of the Sole Shareholder. An Officer’s certificate of the
Sole Shareholder, dated as of the date hereof, (A) evidencing the authorization
by Authorizing Resolution of the execution and delivery of (1) the Amendment
Documents to which the Sole Shareholder is a party; and (2) such related
documents as may be required for the purpose of the

 

Page 3

--------------------------------------------------------------------------------

  Class A Notes Amendments and the Class A-R Notes Amendments and the
transactions contemplated in the Indenture, this Second Amendment Agreement and
the Amendment Documents; and (B) certifying that (1) the copies of the
Authorizing Resolution and Constitutive Documents attached thereto are, in each
case, a true and complete copy thereof; (2) such resolutions have not been
amended or rescinded and are in full force and effect on and as of the date
hereof; and (3) the Officers of the Sole Shareholder or its manager authorized
to execute and deliver such documents hold the offices and have the signatures
indicated thereon.

 

  (iii) Officers’ Certificate of the Collateral Manager. An Officer’s
certificate of the Collateral Manager, dated as of the date hereof,
(A) evidencing the authorization of the execution and delivery on behalf of the
Collateral Manager of (1) the Amendment Documents to which the Collateral
Manager is a party; and (2) such related documents as may be required for the
purpose of the Class A Notes Amendments and the Class A-R Notes Amendments and
the transactions contemplated in the Indenture, this Second Amendment Agreement
and the Amendment Documents; and (B) certifying that (1) the copies of the
Authorizing Resolution and Constitutive Documents attached thereto are, in each
case, a true and complete copy thereof; (2) such authorizations have not been
amended or rescinded and are in full force and effect on and as of the date
hereof; and (3) the Officers of the Collateral Manager authorized to execute and
deliver such documents hold the offices and have the signatures indicated
thereon.

 

(i) Legal Opinions. The Trustee shall have received the following legal
opinions:

 

  (i) U.S. Counsel Opinions. An opinion of Nixon Peabody LLP, counsel to the
Trustee and the Collateral Administrator, and Bingham McCutchen LLP, counsel to
the Issuer, Sole Shareholder and Collateral Manager, each dated the date hereof,
each in form and substance satisfactory to the Trustee and UBS AG.

 

  (ii) Cayman Counsel Opinion. An opinion of Appleby (Cayman) Ltd., Cayman
Islands counsel to the Issuer, dated the date hereof, in form and substance
satisfactory to the Trustee and UBS AG.

 

4. Representations and Warranties; Covenants; other Agreements

 

(a) Each party hereto represents and warrants that this Second Amendment
Agreement has been duly and validly executed and delivered by it and constitutes
its legal, valid and binding obligation, enforceable against it in accordance
with its terms.

 

(b) From time to time, each of the parties hereto will promptly execute and
deliver all such further instruments, certificates and documents, and take all
such further actions as any one of them may deem to be necessary, advisable,
convenient or proper to carry out the intent of this Second Amendment Agreement.

 

Page 4

--------------------------------------------------------------------------------

(c) For the purposes of this Second Amendment Agreement: (i) each of the
Trustee, the Collateral Administrator, the Collateral Manager and each Holder,
by executing and delivering a counterpart of this Second Amendment Agreement,
hereby waives any right under the Transaction Documents to prior notice of this
Second Amendment Agreement; (ii) each Holder and the Collateral Manager, by
executing and delivering a counterpart of this Second Amendment Agreement,
hereby provides their written consent to the execution of this Second Amendment
Agreement, the Indenture and the Omnibus Amendment Agreement, dated on or about
the date hereof, between the Issuer, the Collateral Manager, the Trustee and the
Collateral Administrator, by the Trustee and the Issuer pursuant to Section 8.2
of the Original Indenture; (iii) each of the Issuer, the Collateral Manager and
each Holder, by executing and delivering a counterpart of this Second Amendment
Agreement, hereby agrees that the execution of this Second Amendment Agreement
is authorized and permitted by the Original Indenture and that all conditions
precedent thereto have been satisfied and that, for all purposes under the
Original Indenture, including Section 8.3(b) thereof, the Trustee shall be
permitted to rely on this Section 4(c), and shall be as fully protected in so
relying on this Section 4(c), in lieu of an Opinion of Counsel; and (iv) each of
UBS AG, London Branch and CM Finance Inc., as successor to CM Finance LLC, by
executing and delivering a counterpart of this Second Amendment Agreement,
hereby represents that it is the beneficial owner of Notes having an aggregate
principal amount as indicated above its signature hereto.

 

5. Waiver of Opinion Counsel.

For the purposes of this Second Amendment Agreement, the Trustee, the Collateral
Manager and each Holder, by executing and delivering a counterpart of this
Second Amendment Agreement, hereby waive any requirement under Section 2.13(e)
of the Indenture to obtain an opinion of tax counsel.

 

6. Miscellaneous

 

(a) Successors and Assigns. This Second Amendment Agreement shall be binding
upon and inure to the benefit of the parties hereto and their respective
successors and permitted assigns. No person or entity other than the parties
hereto and their respective successors and permitted assigns shall have any
rights under this Second Amendment Agreement.

 

(b) Entire Agreement. This Second Amendment Agreement constitutes the entire
agreement and understanding of the parties with respect to its subject matter
and supersedes all oral communication and prior writings (except as otherwise
provided herein) with respect thereto.

 

Page 5

--------------------------------------------------------------------------------

(c) Headings. The headings used in this Second Amendment Agreement are for
convenience of reference only and are not to affect the construction of or to be
taken into consideration in interpreting this Second Amendment Agreement.

 

(d) Governing Law. This Second Amendment Agreement shall be construed in
accordance with, and this Second Amendment Agreement and any matters arising out
of or relating in any way whatsoever to this Second Amendment Agreement (whether
in contract, tort or otherwise), shall be governed by, the law of the State of
New York.

 

(e) Jurisdiction. With respect to any suit, action or proceedings relating to
this Second Amendment Agreement or any matter between the parties arising under
or in connection with this Second Amendment Agreement (Proceedings), each party
irrevocably: (i) submits to the non-exclusive jurisdiction of the Supreme Court
of the State of New York sitting in the Borough of Manhattan and the United
States District Court for the Southern District of New York, and any appellate
court from any thereof; and (ii) waives any objection which it may have at any
time to the laying of venue of any Proceedings brought in any such court, waives
any claim that such Proceedings have been brought in an inconvenient forum and
further waives the right to object, with respect to such Proceedings, that such
court does not have any jurisdiction over such party. Nothing in this Second
Amendment Agreement precludes any party from bringing Proceedings in any other
jurisdiction, nor will the bringing of Proceedings in any one or more
jurisdictions preclude the bringing of Proceedings in any other jurisdiction.

 

(f) Waiver of Jury Trial Right. EACH PARTY HEREBY WAIVES, TO THE FULLEST EXTENT
PERMITTED BY APPLICABLE LAW, ANY RIGHT THAT IT MAY HAVE TO A TRIAL BY JURY IN
RESPECT OF ANY PROCEEDINGS. Each party hereby (a) certifies that no
representative, agent or attorney of any other has represented, expressly or
otherwise, that such other would not, in the event of a Proceeding, seek to
enforce the foregoing waiver; and (b) acknowledges that it has been induced to
enter into this Second Amendment Agreement by, among other things, the mutual
waivers and certifications in this paragraph.

 

(g) Counterparts. This Second Amendment Agreement (and each amendment,
modification and waiver in respect of this Second Amendment Agreement) may be
executed and delivered in any number of counterparts (including by e-mail (PDF)
or facsimile), each of which shall be deemed an original and all of which, taken
together, shall constitute one and the same instrument, and each of the parties
hereto may execute this Second Amendment Agreement by signing any such
counterpart. Delivery of an executed counterpart of this Second Amendment
Agreement by e-mail (PDF) or facsimile shall be deemed to constitute due and
sufficient delivery of such counterpart.

 

Page 6

--------------------------------------------------------------------------------

(h) Severability. If any term, provision, covenant or condition of this Second
Amendment Agreement, or the application thereof to any party hereto or any
circumstance, is held to be unenforceable, invalid or illegal (in whole or in
part) for any reason (in any relevant jurisdiction), the remaining terms,
provisions, covenants and conditions of this Second Amendment Agreement,
modified by the deletion of the unenforceable, invalid or illegal portion (in
any relevant jurisdiction), will continue in full force and effect, and such
unenforceability, invalidity, or illegality will not otherwise affect the
enforceability, validity or legality of the remaining terms, provisions,
covenants and conditions of this Second Amendment Agreement, so long as this
Second Amendment Agreement, as so modified continues to express, without
material change, the original intentions of the parties as to the subject matter
hereof and the deletion of such portion of this Second Amendment Agreement, will
not substantially impair the respective expectations or reciprocal obligations
of the parties or the practical realization of the benefits that would otherwise
be conferred upon the parties.

 

Page 7

--------------------------------------------------------------------------------

IN WITNESS WHEREOF, the parties hereto have caused this Second Amendment
Agreement to be duly executed and delivered by their respective signatories
thereunto duly authorized as of the date first written above.

 

CM FINANCE SPV LTD., as Issuer By:  

 

Name:   Title:   STATE STREET BANK AND TRUST COMPANY,
as Trustee and as Bank By:  

 

Name:   Title:   STATE STREET BANK AND TRUST COMPANY,
as Collateral Administrator By:  

 

Name:   Title:   CM INVESTMENT PARTNERS LLC (as successor to CM Investment
Partners, L.P.),
as Collateral Manager By:   MMCMIP LLC, as Managing Member By:  

 

Name:   Title:   MMCMIP Designee

 

Second Amendment Agreement

--------------------------------------------------------------------------------

UBS AG, LONDON BRANCH, as Holder of Notes By:  

 

Name:   Title:   By:  

 

Name:   Title:   CM FINANCE INC. (as successor by merger to CM FINANCE LLC),
as Holder and as Sole Shareholder By:  

 

Name:   Title:  

 

Second Amendment Agreement

--------------------------------------------------------------------------------

EXHIBIT A

SECOND AMENDED AND RESTATED INDENTURE

Exhibit A