Securities and Exchange Commission
                              Washington, D. C. 20549

                                   Schedule 13G
                      Under the Securities Exchange Act of 1934
                                (Amendment No. 1)

                          MGIC Investment Corporation
                                   Common Stock
                              CUSIP Number 552848103

Date of Event Which Requires Filing of this Statement:  December 31, 2001

CUSIP No. 552848103

         1)     Name of reporting person:
                  Legg Mason, Inc.
                 Tax Identification No.:
                  52-1200960

         2)     Check the appropriate box if a member of a group:
                  a)     n/a
                  b)     n/a

         3)     SEC use only

         4)     Place of organization:
                  Maryland

Number of shares beneficially owned by each reporting person with:
         5)     Sole voting power:          - 0 -
         6)     Shared voting power:        14,665,831
         7)     Sole dispositive power:     - 0 -
         8)     Shared dispositive power:   14,665,831

         9)     Aggregate amount beneficially owned by each reporting person:
                  14,665,831

        10)    Check if the aggregate amount in row (9) excludes certain shares:
                  n/a

        11)    Percent of class represented by amount in row (9):
                  13.68%

        12)    Type of reporting person:
                  HC, CO
           ____________________________________________________________________

         Item 1a)     Name of issuer:
                           MGIC Investment Corporation

         Item 1b)     Address of issuer's principal executive offices:
                           MGIC Plaza
                           250 E. Kilbourn Avenue
                           Milwaukee, WI  53202

         Item 2a)    Name of person filing:
                           Legg Mason, Inc.

         Item 2b)    Address of  principal business office:
                           100 Light Street
                           Baltimore, MD  21202

         Item 2c)    Citizenship:
                           Maryland Corporation

         Item 2d)    Title of class of securities:
                           Common Stock

         Item 2e)    CUSIP number:     552848103

         Item 3)     If this statement is filed pursuant to Rule 13d-1(b),
                           or 13d-2(b), check whether the person filing is a :
         (a)    [   ]    Broker or dealer under Section 15 of the Act.
         (b)    [   ]    Bank as defined in Section 3(a) (6) of the Act.
         (c)    [   ]    Insurance Company as defined in Section 3(a) (6) of
                                the Act.
         (d)    [   ]    Investment Company registered under Section 8 of the
                                Investment Company Act.
         (e)    [   ]    Investment Adviser registered under Section 203 of the
                                Investment Advisers Act of 1940.
         (f)    [   ]    Employee Benefit Plan, Pension Fund which is subject
                                to ERISA of 1974 or Endowment Fund; see
                                240.13d-1(b)(ii)(F).
         (g)    [ X ]    Parent holding company, in accordance with
                                240.13d-1(b)(ii)(G).
         (h)    [   ]    Group, in accordance with 240.13d-1(b)(1)(ii)(H

         Item 4)    Ownership:
         (a)     Amount beneficially owned:    14,665,831

         (b)     Percent of Class:  13.68%

         (c)     Number of shares as to which such person has:
                  (i)   sole power to vote or to direct the vote:
                                    -  0 -
                  (ii)  shared power to vote or to direct the vote:
                                    14,665,831
                  (iii) sole power to dispose or to direct the disposition of:
                                    - 0 -
                  (iv)  shared power to dispose or to direct the disposition of:
                                    14,665,831

         Item 5)    Ownership of Five Percent or less of a class:
                           n/a

         Item 6)    Ownership of more than Five Percent on behalf of another
                                person:

                           Various accounts managed by the investment advisory
                           subsidiaries described in Item 7 have the right to
                           receive or the power to direct the receipt of
                           dividends from, or the proceeds from the sale of
                           shares of MGIC Investment Corporation.

                           Accounts managed by Legg Mason Funds Management,
                           Inc. in the aggregate, have the right to receive or
                           the power to direct the receipt of dividends from,
                           or the proceeds from the sale of, 9,562,921 shares,
                           or 8.92%, of the total shares outstanding of MGIC
                           Investment Corporation.

                           The interest of one account, Legg Mason Value Trust,
                           Inc., an investment company registered  under the
                           Investment Company Act of 1940 and  managed by
                           Legg Mason Funds Management, Inc., amounted to
                           8,533,700 shares or 7.96% of the  total shares
                           outstanding.

         Item 7)    Identification and classification of the subsidiary which
                                acquired the security being reported on by the
                                parent holding company:

                         Legg Mason Funds  Management, Inc., investment adviser
                         Bartlett & Co., investment adviser
                         Brandywine Asset Management, LLC, investment adviser
                         Legg Mason Capital Management, Inc., investment adviser
                         Legg Mason Wood Walker, Inc., investment adviser and
                                    broker/dealer with discretion
                         Perigee Investment Counsel, Inc., investment adviser
                         Batterymarch Financial Management, Inc., investment
                                    adviser

         Item 8)    Identification and classification of members of the group:
                           n/a

         Item 9)    Notice of dissolution of group:
                           n/a

         Item 10)   Certification:

                           By signing below I certify that, to the best of my
         knowledge and belief, the securities referred to above were acquired
         and are held in the ordinary course of business and were not acquired
         and are not held for the purpose of or with the effect of changing or
         influencing the control of the issuer of the securities and were not
         acquired and are not held in connection with or as a participant in
         any transaction having that purpose or effect.

                                     Signature
                                    -----------

                           After reasonable inquiry and to the best of my
         knowledge and belief, I certify that the information set forth in this
         statement is true, complete and correct.

         ---------------------------
         Date - February 11, 2002

         Legg Mason, Inc.


         By _____________________________________________________
              Timothy C. Scheve, Sr. Ex. Vice President

                                 Joint Filing Agreement
                               ---------------------------

                          Each party signing below agrees that this statement is
         submitted as  a joint filing on behalf of all of the undersigned.

         Legg Mason, Inc.


         By _____________________________________________
               Timothy C. Scheve, Sr. Ex. Vice President

         Legg Mason Funds Management, Inc.


         By______________________________________________
               Jennifer Murphy, Sr. Vice President

         Legg Mason Value Trust, Inc.


         By_____________________________________________
                 Marc R. Duffy, Vice President