Let $R$ be a prime ring of characteristic different from $2$ with a right Martindale quotient ring $Q_r$ and an extended centroid $C$. Let $F$ be a non zero generalized derivation of $R$ and $S$ be the set of evaluations of a non-central valued multilinear polynomial $f(x_1,\ldots,x_n)$ over $C$. Let $p,q\in R$ be such that
$pF^2(u)u+F^2(u)uq=0$ for all $u\in S$.
Then for all $x\in R$ one of the followings holds:1) there exists $a\in Q_r$ such that $F(x)=ax$ or $F(x)=xa$ and $a^2=0$,2) $p=-q\in C$,3) $f(x_1,\ldots,x_n)^2$ is central valued on $R$ and there exists $a\in Q_r$ such that $F(x)=ax$ with $pa^2+a^2q=0$.