
69 Cal.App.2d 164 (1945)
In re WILLIAM EARL HOWARD, on Habeas Corpus.
Crim. No. 1915. 
California Court of Appeals. Third Dist.  
May 10, 1945.
 William Earl Howard, in pro. per., for Petitioner.
 Robert W. Kenny, Attorney General, and James O. Reavis, Deputy Attorney General, for Respondent.
 PEEK, J.
 By his petition for a writ of habeas corpus petitioner alleges that he is now unlawfully imprisoned and restrained of his liberty by the warden of Folsom penitentiary in that he has served the maximum term of imprisonment as provided by law on the legal portion of the judgment under which he was committed.
 [1] The information to which petitioner pleaded guilty and under which he was adjudged to be an habitual criminal, charged him with the commission of a prior felony in the State of New Mexico, for which he was convicted and served *165 a term in prison in that state. Respondent concedes that the New Mexico conviction was for the theft of an overcoat and a lumber jacket of the value of $45, which, under the laws of the State of California, would have constituted petty and not grand theft; that it was not such a crime as is enumerated in section 644 of the Penal Code, and petitioner has served more than the maximum term of imprisonment under the valid portion of the judgment. However, respondent questions the propriety of habeas corpus under the circumstances.
 On the authority of People v. McChesney, 39 Cal.App.2d 36 [102 P.2d 455]; People v. Pace, 2 Cal.App.2d 464 [38 P.2d 202], and our recent decision In re Connell, 68 Cal.App.2d 360 [156 P.2d 483], we must hold that the trial court erroneously considered the New Mexico conviction as bringing the petitioner within the provisions of said section 644.
 [2] A court cannot impose a greater penalty than that fixed by the statute violated. (13 Cal.Jur.  22, p. 243.) That is not to say that the excessive portion of the sentence herein attacked renders the judgment wholly void. It was a valid sentence for the term authorized by law, and was only void to the extent of the excessive imprisonment imposed. (In re Williams, 4 Cal.App.2d 351 [40 P.2d 890].)
 Therefore, as petitioner has now served more than the term for which he could be lawfully imprisoned for the crime charged in the information, his continued confinement is illegal (In re Morck, 180 Cal. 384 [181 P. 657]; In re Leypoldt, 32 Cal.App.2d 518 [90 P.2d 91]), and under such circumstances the writ of habeas corpus is available to him.
 The petitioner is discharged.
 Adams, P. J., and Thompson, J., concurred.
