Desire is always moved by evil, to fly it: because a total freedom from pain always makes a necessary part of our happiness
 John Locke, An Essay Concerning Human Understanding (1689). copy citation

Context

“A power to direct the operative faculties to motion or rest in particular instances is that which we call the WILL. That which in the train of our voluntary actions determines the will to any change of operation is SOME PRESENT UNEASINESS, which is, or at least is always accompanied with that of DESIRE. Desire is always moved by evil, to fly it: because a total freedom from pain always makes a necessary part of our happiness: but every good, nay, every greater good, does not constantly move desire, because it may not make, or may not be taken to make, any necessary part of our happiness. For all that we desire, is only to be happy.” source