
    The People of the State of New York ex rel. Fredric Maye, Appellant, v Schenectady County Court et al., Respondents.
    [880 NYS2d 868]
   Appeal from a judgment of the Supreme Court (Lalor, J.), entered September 8, 2008 in Greene County, which denied petitioner’s application for a writ of habeas corpus, in a proceeding pursuant to CPLR article 70, without a hearing.

In 2006, petitioner pleaded guilty to attempted criminal sale of a controlled substance in the third degree and waived his right to appeal. When he failed to complete a substance abuse treatment program that would have entitled him to withdraw his plea, he was sentenced as a second felony offender to six years in prison, to be followed by three to five years of post-release supervision. Petitioner appealed his conviction and it was upheld by this Court (People v Maye, 45 AD3d 1110 [2007], lv denied 10 NY3d 866 [2008]). He also made a CPL article 440 motion, which resulted in the postrelease supervision portion of his sentence being reduced to IV2 years. Petitioner then brought the instant application for a writ of habeas corpus, which was denied without a hearing. He now appeals.

We affirm. In his application for habeas corpus relief, petitioner challenges the legality of his sentence and the voluntariness of his plea. Inasmuch as these claims were or could have been raised in his direct appeal or CPL article 440 motion, habeas corpus relief is unavailable (see People ex rel. Carpenter v Corcoran, 46 AD3d 1468, 1468 [2007], lv denied 10 NY3d 706 [2008]; People ex rel. Washington v Walsh, 43 AD3d 1217, 1217 [2007], lv denied 9 NY3d 816 [2007]). Additionally, even if these claims were found to have merit, petitioner would not be entitled to immediate release from prison (see People ex rel. Black v New York State Bd. of Parole, 54 AD3d 1077, 1078 [2008]; People ex rel. Washington v Walsh, 43 AD3d at 1217). Therefore, the petition was properly denied.

Mercure, J.P, Peters, Lahtinen, Kane and Stein, JJ., concur. Ordered that the judgment is affirmed, without costs.  