dma-mapping regression fix for 5.3

- ensure that dma_addressing_limited doesn't crash on devices
    without a dma mask (Eric Auger)
 -----BEGIN PGP SIGNATURE-----
 
 iQI/BAABCgApFiEEgdbnc3r/njty3Iq9D55TZVIEUYMFAl04bXMLHGhjaEBsc3Qu
 ZGUACgkQD55TZVIEUYOw8A//UWbvFvvSI3QBXo+arioiiCl3Z0p+PRJ0wswDuaZf
 Nf3xvtbyoQ3NpK2xOm1+xNdhdHf5Yp3irc/t/WiOPmw8fOpFOBq7WeiSYNtx5uCW
 9GRBSzxga++gjPdXUOQWCHHcFV1+kdfdoPNssCSwZ0rrkMRRF+cG25QNZ9qzawI0
 gsdK4uRaU/wp3u4YCYiiqg4RuGCDZM+KXMruGldc5cVCpRtNa+n2SDKURz40pAb+
 oW7tqH7DCNJbmplAiWq8R94EekWqrWLlHvPjSZ//YOHwFHL2sLKH9uKMSkFQiYw3
 GiLYSZyWHzPERv0u1EA2oLvaS2DQzrn1n1N0fI1iXVSCQLJ9bZiBUtYPJIMf+46l
 /GIs6LKNo5Q2RfuZSlEYJ/mlVrYS2sTdD7GIVf4chXNz/DRQN/ZM8fP+Vi+bLPue
 sgy/fULkVWhG/Er59J0+HTOWPRUQwMElwFppCYlIW+CBe62wVDNWgr2vElRHcCWU
 hwHitPbocVGmY/xQ3PHq9ZKoComO1jQE6gpzu3h2BzqtPWk8xdDix7YpqsyA7RyJ
 ma7U54ve/0Y5y2BTqk8a+RqVqzRqPtPOu0fD2vka32Hcm2ReSPqcb5a/+hRPCcs6
 IzKLifPmj6+HviiwDV4vj3aiZnUPv7NG6AHFyYZn8+0RT/9PKkrXeis1tJxfdYy+
 3a4=
 =OK5z
 -----END PGP SIGNATURE-----

Merge tag 'dma-mapping-5.3-2' of git://git.infradead.org/users/hch/dma-mapping

Pull dma-mapping regression fix from Christoph Hellwig:
 "Ensure that dma_addressing_limited doesn't crash on devices without a
  dma mask (Eric Auger)"

* tag 'dma-mapping-5.3-2' of git://git.infradead.org/users/hch/dma-mapping:
  dma-mapping: use dma_get_mask in dma_addressing_limited
This commit is contained in:
Linus Torvalds 2019-07-24 09:28:55 -07:00
commit c2626876c2

View file

@ -689,8 +689,8 @@ static inline int dma_coerce_mask_and_coherent(struct device *dev, u64 mask)
*/
static inline bool dma_addressing_limited(struct device *dev)
{
return min_not_zero(*dev->dma_mask, dev->bus_dma_mask) <
dma_get_required_mask(dev);
return min_not_zero(dma_get_mask(dev), dev->bus_dma_mask) <
dma_get_required_mask(dev);
}
#ifdef CONFIG_ARCH_HAS_SETUP_DMA_OPS