Given a $$C^{r}$$ function $$f:U\subset {\mathbf {R}}^{n}\rightarrow {\mathbf {R}} ^{m} $$ . Inspired by a recent result due to Moreira and Ruas (Manuscr Math 129:401–408, 2009), we show that for any $$x\in U$$ , there exists a $$\delta (x)>0$$ , such that for all $$y\in B(x,\delta (x))\cap U$$ , it holds $$\begin{aligned} |f(x)-f(y)|\le C_{1}|df(y)||x-y|+C_{2}\sup _{0\le t\le 1}|D^{r}f(x+t(y-x))-D^{r}f(x)||x-y|^{r}, \end{aligned}$$ where $$C_{1},C_{2}$$ depends only on n, m. This inequality can be thought as a generalized Bochnak–Łojasiewicz inequality for smooth functions, it contains a “polynomial term” and a correction term from the finite differentiability. When $$df(y)=0$$ , the inequality improves the classical Morse criticality theorem, therefore, our approach unifies and simplifies various results on Morse criticality theorems, and leads to some streamlined proofs of the Morse–Sard type theorems. To showcase the wide applicability of our inequality, we provide two novel Morse–Sard type results. Define $$ \Sigma _{f}^{\nu }=\{x\in U$$ | rank $$(df(x))\le \nu \dot{\}}$$ . In the first place, if $$f\in C^{k+(\alpha )},k\ge 1,k\in {\mathbb {N}},0<\alpha \le 1 $$ , ( $$C^{k+(\alpha )}$$ , Moreira’s class), then the packing dimension $$\dim _{ {\mathcal {P}}}f(\Sigma _{f}^{0})\le \frac{n}{k+\alpha }$$ . Secondly, we consider $$f\in W^{k+s,p}(U;{\mathbf {R}}^{m}),n>m,k\ge 1,sp>n,0<s\le 1$$ , $$ W^{k+s,p}$$ is the (possibly fractional) Sobolev space. We will show that, for $$f\in W^{k+s,p}(U;{\mathbf {R}}^{m})$$ , $${\mathscr {L}}^{m}(f(\Sigma _{f}^{\nu }))=0$$ if $$k+1\ge \frac{n-\nu }{m-\nu },\nu =0,1, \ldots ,m-1$$ ; for $$f\in W^{k+s,p},0<s<1,{\mathscr {L}}^{m}(f(\Sigma _{f}^{0}))=0$$ , if $$k+s\ge \frac{n}{ m}$$ . To the best of our knowledge, it’s the first result on the Morse–Sard theorem for fractional Sobolev spaces.